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] Placeholder support for EuiSuperSelect / EuiSuperSelectControl #6189

Closed
jtodd3 opened this issue Aug 29, 2022 · 4 comments · Fixed by #6630
Closed

[EuiSuperSelect] Placeholder support for EuiSuperSelect / EuiSuperSelectControl #6189

jtodd3 opened this issue Aug 29, 2022 · 4 comments · Fixed by #6630
Assignees
Labels
feature request help wanted The EUI team is looking for community members to pick up and implement this issue

Comments

@jtodd3
Copy link

jtodd3 commented Aug 29, 2022

Summary

Currently, there is no way to define a placeholder for the EuiSuperSelect component. If you pass in a placeholder value it gets placed in the rest param. Then, the value of rest is spread onto the EuiSuperSelectControl.

Fix

Add a named prop to EuiSuperSelect for the placeholder. If there is no selected value on the component and a placeholder is provided put the placeholder text inside the button with the subdued text color.

Replace lines 156-166 of super_select_control.tsx

 <button
    type="button"
    className={classes}
    aria-haspopup="listbox"
    disabled={disabled || readOnly}
    // @ts-ignore Using as a selector only for mixin use
    readOnly={readOnly}
    {...rest}
>
    {(!selectedValue && placeholder) && <Text color="subdued">{placeholder}</Text>} // whatever size prop you need to use
    {selectedValue}
</button>
@thompsongl thompsongl added feature request help wanted The EUI team is looking for community members to pick up and implement this issue and removed feature request labels Sep 1, 2022
@jtodd3
Copy link
Author

jtodd3 commented Sep 6, 2022

I'm trying to push a branch to create a PR for this issue, but it won't let me.

@daveyholler
Copy link
Contributor

@evangelia-mitsopoulou We'll get this reviewed and prioritized. In the event we can't get to is as quickly as your team needs, we always welcome contributions from others. Please feel free to review the contributing guidelines and open a PR if you'd like.

@evangelia-mitsopoulou
Copy link

evangelia-mitsopoulou commented Feb 22, 2023

@daveyholler thank you for reviewing it. We are under a tight deadline and we decided with my team @elastic/control-plane-iam to proceed for now with our current design. It will be needed from April onwards. Do you think you could find the capacity by that time? If not, we can contribute ourselves.

@cee-chen
Copy link
Contributor

cee-chen commented Mar 7, 2023

@evangelia-mitsopoulou EuiSuperSelect placeholder functionality should be in tomorrow's EUI release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request help wanted The EUI team is looking for community members to pick up and implement this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants