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

[EuiSuperSelect] Dropdown not rendering properly #3565

Closed
elizabetdev opened this issue Jun 5, 2020 · 7 comments · Fixed by #3685
Closed

[EuiSuperSelect] Dropdown not rendering properly #3565

elizabetdev opened this issue Jun 5, 2020 · 7 comments · Fixed by #3685

Comments

@elizabetdev
Copy link
Contributor

I noticed that when we open the EuiSuperSelect and components that reuse this component, in CodeSandBox or with Create React App the dropdown doesn't render properly. It moves 16px to the right:

Screenshot 2020-06-05 at 13 50 13

Example:
https://codesandbox.io/s/example-31jfn

@cchaos
Copy link
Contributor

cchaos commented Jun 5, 2020

Ahh, I know why. It's because it's using the popover service which restricts the popover from getting 16px or close to the window edge. I'd have to check if EuiSuperSelect is using the input popover or not and if so, maybe the input popover needs to be able to negate this "buffer" and always maintain it's position against the input.

cc @thompsongl

@thompsongl
Copy link
Contributor

EuiSuperSelect does not use EuiInputPopover, just the standard EuiPopover service. Passing a buffer of 0 should be enough.

@cchaos
Copy link
Contributor

cchaos commented Jun 5, 2020

We should probably get it to use the Input one anyway? Seems most appropriate usage.

@shrey
Copy link
Contributor

shrey commented Jun 23, 2020

Can I work on this one?

@snide
Copy link
Contributor

snide commented Jun 24, 2020

@shrey go for it, you're on a roll.

@elizabetdev elizabetdev removed their assignment Jun 24, 2020
@shrey
Copy link
Contributor

shrey commented Jun 24, 2020

@snide Thanks :) btw, How do I check if the changes actually work? because on changing it through the console, it seems fine

Screenshot 2020-06-25 at 4 40 15 AM

@elizabetdev
Copy link
Contributor Author

Hi @shrey,

As @cchaos described this issue happens when the EuiSuperSelect is close to a window edge. A way to test is to put the EuiSuperSelect close to the browser window edge. For example on the top left corner with a fixed position.

1

To do that you can edit the eui/src-docs/src/views/super_select/super_select_basic.js and add a wrapper around the EuiSuperSelect:

<div style={{ position: 'fixed', top: 0, left: 0, width: 400 }}>
  <EuiSuperSelect
    options={options}
    valueOfSelected={value}
    onChange={value => onChange(value)}
  />
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants