-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Controls] Use new panelMinWidth
prop in popovers
#165397
[Controls] Use new panelMinWidth
prop in popovers
#165397
Conversation
3ef74a9
to
d14f6fb
Compare
&:not(.controlFrameWrapper--grow) { | ||
.controlFrame__labelToolTip { | ||
max-width: 20%; | ||
} | ||
} |
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.
@@ -43,36 +41,33 @@ export const OptionsListPopover = ({ | |||
const [showOnlySelected, setShowOnlySelected] = useState(false); | |||
|
|||
return ( | |||
<> | |||
<div |
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.
I just removed the wrapping fragment, since it's unnecessary - no other changes were made here.
1e8b569
to
1758d28
Compare
@@ -58,17 +57,6 @@ describe('Options list popover', () => { | |||
showOnlySelectedButton.simulate('click'); | |||
}; | |||
|
|||
test('available options list width responds to container size', async () => { |
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.
The EUI panelMinWidth
applies to the portal that is created for the popover, and not to the popover itself; this portal does not exist from within the popover component, so this test is no longer relevant.
Pinging @elastic/kibana-presentation (Team:Presentation) |
@elasticmachine merge upstream |
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.
lgtm!
code review and tested options list and range slider
hasArrow={false} | ||
repositionOnScroll | ||
isOpen={isPopoverOpen} | ||
panelPaddingSize="none" | ||
anchorPosition="downCenter" | ||
panelMinWidth={MIN_POPOVER_WIDTH} | ||
className="optionsList__inputButtonOverride" | ||
initialFocus={'[data-test-subj=optionsList-control-search-input]'} | ||
closePopover={() => optionsList.dispatch.setPopoverOpen(false)} | ||
aria-label={OptionsListStrings.popover.getAriaLabel(fieldName)} |
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.
Not blocking, but I can't figure out how to get this aria-label to read in VoiceOver.
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.
Ahh, good point! Looks like the aria-label
just doesn't do anything for EuiInputPopover
- I tested this here: https://codesandbox.io/s/laughing-aryabhata-585w4s?file=/demo.js.
Fixed in e82ccfc7b88a9cb2f64a8a9c8e5b181e29db7f50 by passing it in as a panelProp
instead 👍
e82ccfc
to
7675d64
Compare
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @Heenawter |
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.
Design changes LGTM, great improvements!
Closes elastic#164375 ## Summary This PR wraps up elastic#162651 by fully migrating to the `EuiInputPopover` for all controls - specifically, this is made possible by the new `panelMinWidth` prop, which makes it so that the popover can now extend past the size of the input **while maintaining** the expected positioning. | Before | After | |--------|--------| | The popover was centered underneath the control on the smallest size:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/e2814ee2-6df6-47d6-925e-9f97cb8be2a5) | The popover is left-aligned with the start of the input and expands to the right:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/7c698ef0-1534-43b6-ac95-9ae95f1c7613) | | The range slider popover could not extend past the control width, regardless of how small that was:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/12e33967-b616-4f0a-9ded-4374d65a51b2) | The range slider popover now also has a minimum width, which makes it more useable on the smallest size:<br><br>![image](https://github.com/elastic/kibana/assets/8698078/2fb844db-8f5d-44d8-a6dc-c9cb95d5a4ea) | ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]>
Closes #164375
Summary
This PR wraps up #162651 by fully migrating to the
EuiInputPopover
for all controls - specifically, this is made possible by the newpanelMinWidth
prop, which makes it so that the popover can now extend past the size of the input while maintaining the expected positioning.Checklist
For maintainers