Repository navigation
fix: option key does not work in addClickShortCut() method - #16086
Conversation
…ggering Alt, AltGraph, both of them shall work).
- Added tests in ShortcutEventTest and created new test class for testing filterText generation ShortCutRegistrationFilterText, - Some smaller comment/typo fixes in (Shortcuts), - Changed the fix itselfes as the tests shows it is not handling all the cases properly
…and forgot to remove the !. Now it shall be good!
…ll refactor to have inline variable.
5fcd8fa to
76fd8b9
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
* Investigations comments to relevant parts.
* formatted files with mvn formatter:format
* added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work).
* removing comments, and potential solutions which will not be used anymore.
* Cleaned up comments to make it cleaner (ShortcutRegistration)
- Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText,
- Some smaller comment/typo fixes in (Shortcuts),
- Changed the fix itself as the tests show it is not handling all the cases properly
* mvn formatter:format executed.
*fix test name typo.
* assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !.
Now it shall be good!
* after manual testing the code was fixed.
* fix the tests for covering the changes that happened in ShortCutRegistration.
* mvn formatter:format run once again.
* added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable.
* mvn formatter:format run once again + some new asserts in tets as well.
* cleanup the code based on Tepi's review, idea! (Thanks!)
* "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases.
(https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates)
* minor cleanup (Teppo)
---------
Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
* Investigations comments to relevant parts.
* formatted files with mvn formatter:format
* added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work).
* removing comments, and potential solutions which will not be used anymore.
* Cleaned up comments to make it cleaner (ShortcutRegistration)
- Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText,
- Some smaller comment/typo fixes in (Shortcuts),
- Changed the fix itself as the tests show it is not handling all the cases properly
* mvn formatter:format executed.
*fix test name typo.
* assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !.
Now it shall be good!
* after manual testing the code was fixed.
* fix the tests for covering the changes that happened in ShortCutRegistration.
* mvn formatter:format run once again.
* added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable.
* mvn formatter:format run once again + some new asserts in tets as well.
* cleanup the code based on Tepi's review, idea! (Thanks!)
* "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases.
(https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates)
* minor cleanup (Teppo)
---------
Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
…16250) * Investigations comments to relevant parts. * formatted files with mvn formatter:format * added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work). * removing comments, and potential solutions which will not be used anymore. * Cleaned up comments to make it cleaner (ShortcutRegistration) - Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText, - Some smaller comment/typo fixes in (Shortcuts), - Changed the fix itself as the tests show it is not handling all the cases properly * mvn formatter:format executed. *fix test name typo. * assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !. Now it shall be good! * after manual testing the code was fixed. * fix the tests for covering the changes that happened in ShortCutRegistration. * mvn formatter:format run once again. * added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable. * mvn formatter:format run once again + some new asserts in tets as well. * cleanup the code based on Tepi's review, idea! (Thanks!) * "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases. (https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates) * minor cleanup (Teppo) --------- Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com> Co-authored-by: czp13 <61667986+czp13@users.noreply.github.com>
…16251) * Investigations comments to relevant parts. * formatted files with mvn formatter:format * added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work). * removing comments, and potential solutions which will not be used anymore. * Cleaned up comments to make it cleaner (ShortcutRegistration) - Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText, - Some smaller comment/typo fixes in (Shortcuts), - Changed the fix itself as the tests show it is not handling all the cases properly * mvn formatter:format executed. *fix test name typo. * assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !. Now it shall be good! * after manual testing the code was fixed. * fix the tests for covering the changes that happened in ShortCutRegistration. * mvn formatter:format run once again. * added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable. * mvn formatter:format run once again + some new asserts in tets as well. * cleanup the code based on Tepi's review, idea! (Thanks!) * "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases. (https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates) * minor cleanup (Teppo) --------- Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com> Co-authored-by: czp13 <61667986+czp13@users.noreply.github.com>
|
Hi @czp13 and @czp13, when i performed cherry-pick to this commit to 2.9, i have encountered the following issue. Can you take a look and pick it manually? |
* Investigations comments to relevant parts.
* formatted files with mvn formatter:format
* added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work).
* removing comments, and potential solutions which will not be used anymore.
* Cleaned up comments to make it cleaner (ShortcutRegistration)
- Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText,
- Some smaller comment/typo fixes in (Shortcuts),
- Changed the fix itself as the tests show it is not handling all the cases properly
* mvn formatter:format executed.
*fix test name typo.
* assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !.
Now it shall be good!
* after manual testing the code was fixed.
* fix the tests for covering the changes that happened in ShortCutRegistration.
* mvn formatter:format run once again.
* added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable.
* mvn formatter:format run once again + some new asserts in tets as well.
* cleanup the code based on Tepi's review, idea! (Thanks!)
* "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases.
(https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates)
* minor cleanup (Teppo)
---------
Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
|
Hi @czp13 and @czp13, when i performed cherry-pick to this commit to 2.8, i have encountered the following issue. Can you take a look and pick it manually? |
* Investigations comments to relevant parts.
* formatted files with mvn formatter:format
* added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work).
* removing comments, and potential solutions which will not be used anymore.
* Cleaned up comments to make it cleaner (ShortcutRegistration)
- Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText,
- Some smaller comment/typo fixes in (Shortcuts),
- Changed the fix itself as the tests show it is not handling all the cases properly
* mvn formatter:format executed.
*fix test name typo.
* assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !.
Now it shall be good!
* after manual testing the code was fixed.
* fix the tests for covering the changes that happened in ShortCutRegistration.
* mvn formatter:format run once again.
* added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable.
* mvn formatter:format run once again + some new asserts in tets as well.
* cleanup the code based on Tepi's review, idea! (Thanks!)
* "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases.
(https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates)
* minor cleanup (Teppo)
---------
Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
…16254) * Investigations comments to relevant parts. * formatted files with mvn formatter:format * added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work). * removing comments, and potential solutions which will not be used anymore. * Cleaned up comments to make it cleaner (ShortcutRegistration) - Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText, - Some smaller comment/typo fixes in (Shortcuts), - Changed the fix itself as the tests show it is not handling all the cases properly * mvn formatter:format executed. *fix test name typo. * assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !. Now it shall be good! * after manual testing the code was fixed. * fix the tests for covering the changes that happened in ShortCutRegistration. * mvn formatter:format run once again. * added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable. * mvn formatter:format run once again + some new asserts in tets as well. * cleanup the code based on Tepi's review, idea! (Thanks!) * "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases. (https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates) * minor cleanup (Teppo) --------- Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com> Co-authored-by: czp13 <61667986+czp13@users.noreply.github.com>
…CP: 9.0) (#16255) * fix: option key does not work in addClickShortCut() method (#16086) * Investigations comments to relevant parts. * formatted files with mvn formatter:format * added potential solution, need to add covering tests as well (for triggering Alt, AltGraph, both of them shall work). * removing comments, and potential solutions which will not be used anymore. * Cleaned up comments to make it cleaner (ShortcutRegistration) - Added tests in ShortcutEventTest and created a new test class for testing filterText generation ShortCutRegistrationFilterText, - Some smaller comment/typo fixes in (Shortcuts), - Changed the fix itself as the tests show it is not handling all the cases properly * mvn formatter:format executed. *fix test name typo. * assertFalse refactor went wrong (double negation), I used assertTrue and forgot to remove the !. Now it shall be good! * after manual testing the code was fixed. * fix the tests for covering the changes that happened in ShortCutRegistration. * mvn formatter:format run once again. * added JavaDoc for the test Reflection used util methods, and some small refactor to have inline variable. * mvn formatter:format run once again + some new asserts in tets as well. * cleanup the code based on Tepi's review, idea! (Thanks!) * "&&&&".split("&&", Integer.MAX_VALUE) -> this will give back ["", "", ""], but without the second parameter, it would have not found these... So with this fix, we will cover more cases. (https://stackoverflow.com/questions/18815911/string-split-and-dealing-with-duplicates) * minor cleanup (Teppo) --------- Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com> * Fix the code in ShortcutRegistration to compile in Java 9 as well (thanks @mshabarov). --------- Co-authored-by: czp13 <61667986+czp13@users.noreply.github.com> Co-authored-by: Peter Czuczor <czuczor@gmail.com>
…ndle more implementations of Key interface and fix browser differences. (#16276)(#16086)(CP: 2.8) (#16362) * fix: Mozilla Firefox vs chrome browser implementation differences for option key, * chore: optimize getModifierKey method, to handle more implementations of Key interface: (#16276) * Make this code: .contains(new HashableKey(KeyModifier.ALT)) to work for more universal cases: .stream().anyMatch(key -> key.matches(Key.ALT.toString())); It should work now for HashableKeys and for other Key implementations as well. * Format the code and make it work for older Java versions as well. * As Key.Alt actually will be a collection of keys (key and additional keys), we need to look for the "Alt" itself. (Key ALT = Key.of("Alt", "AltLeft") * chore: added covering tests as well for this cherry-picked improvement.
…ndle more implementations of Key interface and fix browser differences. (#16276)(#16086)(CP: 2.9) (#16361) * fix: Mozilla Firefox vs chrome browser implementation differences for option key, * chore: optimize getModifierKey method, to handle more implementations of Key interface: (#16276) * Make this code: .contains(new HashableKey(KeyModifier.ALT)) to work for more universal cases: .stream().anyMatch(key -> key.matches(Key.ALT.toString())); It should work now for HashableKeys and for other Key implementations as well. * Format the code and make it work for older Java versions as well. * As Key.Alt actually will be a collection of keys (key and additional keys), we need to look for the "Alt" itself. (Key ALT = Key.of("Alt", "AltLeft") * chore: added covering tests as well for this cherry-picked improvement.








Description
This is a draft PR so do not merge please until we did not discuss it thoroughly.Contex:
In Firefox, the option key is not working. The reason behind this as the browser implementing differently the KeyboardEvent when the option key is pushed, and when getModifierState() is called it will give back different true or false events based on whether you are using Chrome or Firefox.
The difference comes down to this:
Mozzila:
Chrome:
For more information:
Check to please the table for
When getModifierState() returns true on Gecko?here:Fixes # (issue)
#7798
Type of change
Checklist
Additional for
Featuretype of change