On Wed, 7 Oct 2026 06:29:48 GMT, Robert Lichtenberger <[email protected]> 
wrote:

>> As analysed in the bug, the previousWord() method does not work correctly if 
>> at the word boundary a character is found that is neither letter nor digit.
>> This fix changes the method so that only ranges of whitespace will be 
>> skipped, resulting in correct word selection behaviour.
>> A test case has been added to TextAreaTest.
>> gradlew :controls:test --tests test.javafx.scene.control.Text*Test has been 
>> executed to ensure no regressions happen in other text related classes. No 
>> errors were reported.
>> 
>> 
>> ---------
>> - [X] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Robert Lichtenberger has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   8264588: Split test to cover current fix.

modules/javafx.controls/src/test/java/test/javafx/scene/control/behavior/TextInputControlTestBase.java
 line 483:

> 481:             MouseEventFirer mouse = new MouseEventFirer(control);
> 482:             for (int i = 1; i <= clickCount; i++) {
> 483:                 mouse.fireMousePressAndRelease(i, (leading ? 
> bounds.getMinX() : bounds.getMaxX()) - control.getLayoutBounds().getWidth() / 
> 2, bounds.getMinY() - control.getLayoutBounds().getHeight() / 2);

clicking exactly on the character boundary (`bounds.getMinX() : 
bounds.getMaxX()`) might backfire - perhaps we should do something like


double dw = 0.1 * (bounds.getMaxX() - bounds.getMinX());
double x = leading ? (bounds.getMinX() + dw) : (bounds.getMaxX() - dw);

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2334#discussion_r4212318481

Reply via email to