RFR: 8252236: TabPane: must keep header of selected tab visible [v2]

Jeanette Winzenburg fastegal at openjdk.java.net
Wed Sep 23 08:41:47 UTC 2020


On Wed, 23 Sep 2020 06:55:42 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> Jeanette Winzenburg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   widened scope of fix to address review comment
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java line 855:
> 
>> 853:                         } else {
>> 854:                         }
>> 855:                         validateScrollOffset();
> 
> This seems to be an unintended change. If so please revert.

good eye :) Forgot to remove the empty else block.

Validate must be called always if the tabs are not fitting: needed if the last tab (in the list) is visible and we
remove tabs from the end. Without, the now last tab is not kept glued to the trailing edge. There are two tests
covering the corner case (testRemoveXXLast) which fail if we don't.

Question is if that should be mentioned in a code comment? Personally, I tend to just delete the empty block.

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

PR: https://git.openjdk.java.net/jfx/pull/300


More information about the openjfx-dev mailing list