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

Introduce dropdown options for HvDropdown Component #4294

Open
2 tasks done
ashok-he opened this issue Aug 22, 2024 · 1 comment
Open
2 tasks done

Introduce dropdown options for HvDropdown Component #4294

ashok-he opened this issue Aug 22, 2024 · 1 comment
Labels
📬 waiting feedback Waiting for assigned user feedback

Comments

@ashok-he
Copy link

Latest version

  • I have tested the latest version

No Hitachi confidential content

  • I'm not including any Hitachi confidential content

Summary 💡

Currently the HvDropdown component doesn't have options props or menuitems as children. The options and values are integrated together and commonly uses as value prop. In such case handling the selected state and updating the state values is coupled and the user needs to do that login on the frontend!

Examples 🌈

We can use something similar to MUI Select components(https://mui.com/material-ui/react-select/)! or react select component(https://www.npmjs.com/package/react-select). This way we can decouple the dependency between options and values in HvDropdown component.

Ex 1) React Select
Ex 2) MUI Select Age <Select labelId="demo-simple-select-label" id="demo-simple-select" value={age} label="Age" onChange={handleChange} <MenuItem value={10}>Ten</MenuItem> <MenuItem value={20}>Twenty</MenuItem> <MenuItem value={30}>Thirty</MenuItem>

Motivation 🔦

No response

@ashok-he ashok-he added the ⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer. label Aug 22, 2024
@zettca
Copy link
Member

zettca commented Aug 26, 2024

Hello @ashok-he 👋

Please take a look at our HvSelect component: https://lumada-design.github.io/uikit/master/?path=/docs/components-select--docs

It's a simpler component that doesn't include BulkActions or Search, but gives the user full control over the rendering of the options. The rendering and selection state are decoupled.
The API is really similar to MUI's Select, as the implementation is based on their useSelect hook

@zettca zettca added 📬 waiting feedback Waiting for assigned user feedback and removed ⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer. labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 waiting feedback Waiting for assigned user feedback
Projects
None yet
Development

No branches or pull requests

2 participants