-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(DataTable): option to show overflow menu on hover #5822
feat(DataTable): option to show overflow menu on hover #5822
Conversation
This change introduces `overflowMenuOnHover` prop to `<DataTable>` that determines whether or not to show overflow menu on hover, by changing CSS class of `<Table>` as follows: * `overflowMenuOnHover={true}` _unsets_ `bx--data-table--visible-overflow-menu` * `overflowMenuOnHover={false}` _sets_ `bx--data-table--visible-overflow-menu` That CSS class changes the behavior of overflow menu in `<TableCell className="bx--table-column-menu">`; The former above shows overflow menu only on hover, the latter above shows overflow menu always. Though our latest design dictates that showing overflow menu on hover should be optional, this change sets `overflowMenuOnHover={true}` as the default. This is because of the following reasons: 1. `<DataTable>` has never set `bx--data-table--visible-overflow-menu` before and thus setting it by default will be a breaking change 2. Showing overflow menu always can alternately be (and has been in our stories) achieved by _not_ setting `className="bx--table-column-menu"` to `<TableCell>` Fixes carbon-design-system#5804.
Deploy preview for carbon-elements ready! Built with commit 846fc3a |
Deploy preview for carbon-components-react ready! Built with commit 846fc3a https://deploy-preview-5822--carbon-components-react.netlify.com |
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.
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.
Yes to what @emyarod said. The overflows should be centered vertically within each row.
Thanks you for reviewing @emyarod @laurenmrice - Fixed. |
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 to me ! thanks 🙌🏻
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.
👍 ✅
This change introduces
overflowMenuOnHover
prop to<DataTable>
that determines whether or not to show overflow menu on hover, by changing CSS class of<Table>
as follows:overflowMenuOnHover={true}
unsetsbx--data-table--visible-overflow-menu
overflowMenuOnHover={false}
setsbx--data-table--visible-overflow-menu
That CSS class changes the behavior of overflow menu in
<TableCell className="bx--table-column-menu">
; The former above shows overflow menu only on hover, the latter above shows overflow menu always.Though our latest design dictates that showing overflow menu on hover should be optional, this change sets
overflowMenuOnHover={true}
as the default. This is because of the following reasons:<DataTable>
has never setbx--data-table--visible-overflow-menu
before and thus setting it by default will be a breaking changeclassName="bx--table-column-menu"
to<TableCell>
Fixes #5804.
Changelog
New
overflowMenuOnHover
prop to<DataTable>
Testing / Reviewing
Testing should make sure
<DataTable>
with overflow menu isn't broken.