New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8237453: [TabPane] Incorrect arrow key traversal through tabs after reordering #106
Conversation
👋 Welcome back arapte! A progress list of the required criteria for merging this PR into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@arapte This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type
Since the source branch of this PR was last updated there have been 7 commits pushed to the ➡️ To integrate this PR with the above commit message, type |
/reviewers 2 |
@kevinrushforth |
I'd like @aghaisas to take a look as well. |
/integrate |
@arapte The following commits have been pushed to master since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit 21d3b7e. |
Mailing list message from Ambarish Rapte on openjfx-dev: Changeset: 21d3b7e 8237453: [TabPane] Incorrect arrow key traversal through tabs after reordering Reviewed-by: kcr, aghaisas ! modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java |
Issue:
Dragging a tab and dropping it back to it's original position causes an incorrect reordering of tabs. Incorrect order of tabs can be observed using arrow key traversal through tabs.
Cause:
Below mechanism of identifying if tab header is dragged and dropped at same position is not reliable.
When a tab is selected for dragging, the tab's layout X is stored as
dragHeaderStartX
.When the tab is dropped, the tab's destination layout X is saved as
dragHeaderDestX
.These two values are used to decide if the reordering of tabs is needed.
This is an unreliable mechanism in two cases,
When the
TabPane.TabClosingPolicy
is set toTabPane.TabClosingPolicy.SELECTED_TAB
, the close button icon gets added only to the selected tab.Each time when the tab selection is changed, the header region needs a re-layout. When a non selected tab is chosen for dragging
dragHeaderStartX
anddragHeaderDestX
will always differ.Calculation of
dragHeaderDestX
involves floating point operation. So the computeddragHeaderDestX
may sometimes vary by fraction thandragHeaderStartX
.Fix:
Use the index of tab header for identifying the tabs which are reordered.
Save the index when reordering begins.
dragTabHeaderStartIndex
Save the index when tab is dropped.
dragTabHeaderIndex
If the index are same then reordering of tabs is NOT needed.
If the index are NOT same then the tabs from
dragTabHeaderStartIndex
todragTabHeaderIndex
are reordered.Verification:
This fix is specific to TabPane reordering. No other tests/behavior should be affected.
Added a new system test.
Progress
Issue
JDK-8237453: [TabPane] Incorrect arrow key traversal through tabs after reordering
Approvers