Re: RFR: 8282290: TextField Cursor Position one off [v3]

2023-12-05 Thread Marius Hanl
On Fri, 1 Dec 2023 14:28:43 GMT, Karthik P K wrote: >> The change listener on caretPositionProperty() was not getting invoked on >> replacing the content with same text as there was no change in caret >> position. Since the textProperty invalidation sets the forward bias to true >> by default,

Re: RFR: 8282290: TextField Cursor Position one off [v3]

2023-12-04 Thread Karthik P K
On Fri, 1 Dec 2023 14:28:43 GMT, Karthik P K wrote: >> The change listener on caretPositionProperty() was not getting invoked on >> replacing the content with same text as there was no change in caret >> position. Since the textProperty invalidation sets the forward bias to true >> by default,

Re: RFR: 8282290: TextField Cursor Position one off [v3]

2023-12-01 Thread Andy Goryachev
On Fri, 1 Dec 2023 14:28:43 GMT, Karthik P K wrote: >> The change listener on caretPositionProperty() was not getting invoked on >> replacing the content with same text as there was no change in caret >> position. Since the textProperty invalidation sets the forward bias to true >> by default,

Re: RFR: 8282290: TextField Cursor Position one off [v3]

2023-12-01 Thread Karthik P K
> The change listener on caretPositionProperty() was not getting invoked on > replacing the content with same text as there was no change in caret > position. Since the textProperty invalidation sets the forward bias to true > by default, incorrect caret position was calculated when the same te

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-12-01 Thread Karthik P K
On Thu, 30 Nov 2023 07:44:13 GMT, Karthik P K wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Code review > > @andy-goryachev-oracle and @Maran23 please re-review when you get a chance. > @karthikpandelu I think th

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-12-01 Thread Karthik P K
On Thu, 30 Nov 2023 17:47:40 GMT, Andy Goryachev wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Code review > > modules/javafx.controls/src/main/java/javafx/scene/control/skin/TextFieldSkin.java > line 248: > >>

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-11-30 Thread Andy Goryachev
On Thu, 16 Nov 2023 06:54:04 GMT, Karthik P K wrote: >> The change listener on caretPositionProperty() was not getting invoked on >> replacing the content with same text as there was no change in caret >> position. Since the textProperty invalidation sets the forward bias to true >> by default

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-11-30 Thread Andy Goryachev
On Thu, 16 Nov 2023 06:50:36 GMT, Karthik P K wrote: >> Yes, right now it is a bit magic. At least the first if can be simplified >> still, as `!= 4` will also handle `== 0`. > > I agree with Andy here. However the first condition can be simplified without > any side effects but I had seen some

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-11-30 Thread Andy Goryachev
On Thu, 30 Nov 2023 07:44:13 GMT, Karthik P K wrote: >> Karthik P K has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Code review > > @andy-goryachev-oracle and @Maran23 please re-review when you get a chance. @karthikpandelu I think this

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-11-29 Thread Karthik P K
On Thu, 16 Nov 2023 06:54:04 GMT, Karthik P K wrote: >> The change listener on caretPositionProperty() was not getting invoked on >> replacing the content with same text as there was no change in caret >> position. Since the textProperty invalidation sets the forward bias to true >> by default

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-11-15 Thread Karthik P K
On Wed, 15 Nov 2023 19:47:28 GMT, Marius Hanl wrote: >> this might be problematic, as it uses undocumented aspect of >> Text/Flow.caretShape(). the current implementation returns either a single >> line, or two lines (moveto,lineto,moveto,lineto) in the case of split/dual >> caret. But this

Re: RFR: 8282290: TextField Cursor Position one off [v2]

2023-11-15 Thread Karthik P K
> The change listener on caretPositionProperty() was not getting invoked on > replacing the content with same text as there was no change in caret > position. Since the textProperty invalidation sets the forward bias to true > by default, incorrect caret position was calculated when the same te

Re: RFR: 8282290: TextField Cursor Position one off

2023-11-15 Thread Marius Hanl
On Wed, 15 Nov 2023 19:02:09 GMT, Andy Goryachev wrote: >> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TextFieldSkin.java >> line 248: >> >>> 246: textNode.caretShapeProperty().addListener(observable -> { >>> 247: >>> caretPath.getElements().setAll(textN

Re: RFR: 8282290: TextField Cursor Position one off

2023-11-15 Thread Andy Goryachev
On Wed, 15 Nov 2023 18:20:14 GMT, Marius Hanl wrote: >> The change listener on caretPositionProperty() was not getting invoked on >> replacing the content with same text as there was no change in caret >> position. Since the textProperty invalidation sets the forward bias to true >> by default

Re: RFR: 8282290: TextField Cursor Position one off

2023-11-15 Thread Marius Hanl
On Tue, 14 Nov 2023 10:24:20 GMT, Karthik P K wrote: > The change listener on caretPositionProperty() was not getting invoked on > replacing the content with same text as there was no change in caret > position. Since the textProperty invalidation sets the forward bias to true > by default, in