RFR: 8178368: Right alignment of text fields and alignment of prompt text works incorrectly [v7]
Karthik P K
kpk at openjdk.org
Tue Feb 28 13:33:24 UTC 2023
On Tue, 28 Feb 2023 13:30:57 GMT, Karthik P K <kpk at openjdk.org> wrote:
>> When Text width was more than TextField width, the logic to update `textTranslateX` in `updateCaretOff` method was causing the issue of unexpected behavior for Right and Center alignment.
>>
>> Made changes to update `textTranslateX` in `updateCaretOff` method only when text width is less than text field width i.e `delta` is positive.
>> For both right and center alignments, the `textTranslateX` value calculated in `updateTextPos` method will be updated without any condition so that expected behavior is achieved for all scenarios of text width relative to text field width.
>>
>> Added unit tests to validate LEFT, CENTER and RIGHT alignments. RIGHT and CENTER alignment tests are expected to fail without the fix provided in this PR.
>
> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix text scroll issue when right aligned
Fixed the issue of text not getting scrolled on typing from left edge of the right aligned text whose length is more than the text field length.
The switch cases present in `scrollAfterDelete()` is not required as the block of code which is present for case RIGHT induces the unwanted behavior. Conditions to update `textTranslateX` in this method can be same for all the type of alignments.
-------------
PR: https://git.openjdk.org/jfx/pull/980
More information about the openjfx-dev
mailing list