Compare the changes made here against some of the original code changes in #11127 - it appears that a merge conflict got incorrectly applied at some point. There was originally proper inverted-range handling, but it got overwritten with code that couldn't properly handle it.
User Testing
TEST_INVERTED_SELECTION_RANGE: Using Keyman for Android as a system keyboard, ensure that backwards selection ranges do not crash the keyboard.
Select text, then drag one of the end points through and past the other one.
If the keyboard immediately disappears, or you see an error notification, FAIL this test.
✅ TEST_INVERTED_SELECTION_RANGE (PASSED): I tested this issue with the attached "Keyman 17.0.319-beta-test-11345" build on an Android 14 environment: Here is my observation. 1. Installed the "keyman-17.0.319.apk" file and gave all permissions to the application. 2. Checked the "Enable Keyman as system-wide keyboard" and set the keyboard as the default keyboard boxes on the settings page. 3. Open the Chrome browser and enter some text in the search box. 4. The keyboard did not disappear when selecting some text from right to left and left to right. 5. The keyboard appears while dragging the text selection. It works well and behaves as expected now.
TEST_INVERTED_SELECTION_RANGE (PASSED): I tested this issue with the attached "Keyman 17.0.319-beta-test-11345" build on an Android 14 environment: Here is my observation. 1. Installed the "keyman-17.0.319.apk" file and gave all permissions to the application. 2. Checked the "Enable Keyman as system-wide keyboard" and set the keyboard as the default keyboard boxes on the settings page. 3. Open the Chrome browser and enter some text in the search box. 4. The keyboard did not disappear when selecting some text from right to left and left to right. 5. The keyboard appears while dragging the text selection. It works well and behaves as expected now.
Fixes #11344.
Compare the changes made here against some of the original code changes in #11127 - it appears that a merge conflict got incorrectly applied at some point. There was originally proper inverted-range handling, but it got overwritten with code that couldn't properly handle it.
User Testing
TEST_INVERTED_SELECTION_RANGE: Using Keyman for Android as a system keyboard, ensure that backwards selection ranges do not crash the keyboard.