'Chrome crashes when try to use spell checker to correct the spelling of words in a Vaadin text field

When I try to use Google Chrome's spell checker to correct the spelling of words in a text field or text area, Chrome crashes and displays the “Aw, Snap!” error message. This issue is only present on Chrome. This is the sample code for reproducing the issue. As soon as I right click on the red underlined word, Chrome crashes and it displays the error page. If there are multiple misspelled words in text field, only the last word causing an issue. I don’t have any issue with using spell checker for other words expect the last one, “mssage” in this case. I also don’t have any issue when there is another correctly spelled word after the misspelled word. In this case, it doesn’t crash.

In general, what I observed is that if the misspelled word is the last word in the text field, then the crash occurs; otherwise, it works as expected. I have checked all log files including Chrome local logs, but there is no log message related to this issue, and I am not able to debug it. I found a few partial solutions, but still couldn’t understand the root cause of this issue.

Partial solution-1: If we remove the text from the Button, the issue is resolved. As you can see, the button doesn’t have any text written on it, and in this case, it works as expected.

Partial solution-2: If we swap the order of the Button and Text Field, the issue is resolved. When I add components to the layout, the order makes a difference. When the button is added before the text field, the issue isn't there.

Partial solution-3: This is the solution I am currently using since the first 2 solutions require me to change my layout. If I add the suffix (sample code included) to the text field, the issue is resolved; however, the suffix has to have text in it, otherwise it doesn’t solve the issue. I added Label with “.” and set opacity to “0” to make it invisible on the user end.

Thank you so much.



Solution 1:[1]

I was able to reproduce your issue in Chrome Version 91.0.4472.114 in macOS and it works after upgrading to Version 92.0.4515.107. It was already reported in bugs.chromium.org and it's fixed in latest Chrome.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guille