RFR: 8252863: Spinner keeps spinning if removed from Scene [v2]

Andy Goryachev angorya at openjdk.org
Sat Dec 17 19:59:58 UTC 2022


On Fri, 16 Dec 2022 04:51:53 GMT, Karthik P K <kpk at openjdk.org> wrote:

>> Spinner was not stopping because it was getting removed from scene before the mouse release event handler was getting invoked.
>> 
>> Added listener for `sceneProperty` so that when Spinner is removed from the scene, `stopSpinning` method shall be called.
>> 
>> Added unit test to validate the fix
>
> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use ListenerHelper for sceneProperty

minor corrections, let me know what you think.  otherwise almost done!

modules/javafx.controls/src/main/java/javafx/scene/control/skin/SpinnerSkin.java line 258:

> 256:             behavior.stopSpinning();
> 257:         });
> 258: 

minor: could we get rid of this extra newline?

modules/javafx.controls/src/test/java/test/javafx/scene/control/skin/SpinnerSkinTest.java line 178:

> 176:         assertEquals(Status.RUNNING, SpinnerBehaviorShim.getTimeline(behavior).getStatus());
> 177:         root.getChildren().clear();
> 178:         assertEquals(Status.STOPPED, SpinnerBehaviorShim.getTimeline(behavior).getStatus());

just curious: if we add the spinner back to the scene, should it spin again?  do we want  to add this condition to this test?

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

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


More information about the openjfx-dev mailing list