Skip to content
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

feat(ui5-table): improve horizontal scrolling #9293

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

DonkeyCo
Copy link
Member

  • add horizontal scrollbar, when overflow-mode is set to Scroll
  • when selection is enabled, the column is fixed to the left
  • handle focus when focus below fixed column

@DonkeyCo DonkeyCo requested a review from aborjinik June 24, 2024 16:07
* @public
*/
@property()
height = "auto";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if i liked this property, i guess you know why.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it for now. Leads to issues if you set the table to Scroll mode (because of overflow-x: auto)

top: elementRect.top - stickyBottom,
});
// Handles focus in the table, when the focus is below a sticky element
scrollElementIntoView(this._scrollContainer, e.target as HTMLElement, this._stickyElements);
Copy link
Contributor

@aborjinik aborjinik Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be really complicated when e.g. if group headers came into topic also doing this calculation on every focusin feels a little wrong.
we are discussing how to handle this for the m/Table better there with using scroll-padding-top but here in WC we somehow do not know the scroll container, heights might change, bla bla.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scroll-padding-top would be a nice solution as well for the WC, but there is a problem with the focus.
If the element is outside of the container/not visible, focusing the element will center it in the viewport, which is a bit weird.
We could circumvent this by doing a programatic call to element.scrollIntoView(), then it is aligned to the top

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the element is outside of the container/not visible, focusing the element will center it in the viewport, which is a bit weird.

I didn't get how user will focus if the element is not visible, but if this is the default of the browser then it should be fine.

- adjust code according to feedback
- adjust focus logic to account for rtl
@DonkeyCo DonkeyCo requested a review from aborjinik July 2, 2024 07:06
packages/main/src/Table.ts Outdated Show resolved Hide resolved
packages/main/src/Table.ts Outdated Show resolved Hide resolved
packages/main/src/Table.ts Outdated Show resolved Hide resolved
packages/main/src/TableHeaderRow.ts Outdated Show resolved Hide resolved
@DonkeyCo DonkeyCo requested a review from aborjinik July 5, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants