On Wed, 21 Dec 2022 10:58:50 GMT, Karthik P K <k...@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.

This pull request has now been integrated.

Changeset: 147d71fa
Author:    Karthik P K <k...@openjdk.org>
Committer: Ajit Ghaisas <aghai...@openjdk.org>
URL:       
https://git.openjdk.org/jfx/commit/147d71fa3cb2e0049ed2ae2bbeeb565fc5f95a91
Stats:     129 lines in 2 files changed: 87 ins; 27 del; 15 mod

8178368: Right alignment of text fields and alignment of prompt text works 
incorrectly

Reviewed-by: angorya, kcr

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

PR: https://git.openjdk.org/jfx/pull/980

Reply via email to