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

[joy-ui][Select] Floating label Select #42012

Closed
atillaaliyev opened this issue Apr 24, 2024 · 7 comments
Closed

[joy-ui][Select] Floating label Select #42012

atillaaliyev opened this issue Apr 24, 2024 · 7 comments
Labels
component: select This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy

Comments

@atillaaliyev
Copy link

atillaaliyev commented Apr 24, 2024

Summary

I want to design floating label select but i dont know what is the right solution (access to button or root slot of Select) .If you check below example , the label floats but animation effect doesn't work. Do you have any example or documentation plan?

Examples

https://codesandbox.io/p/sandbox/select-floating-label-8lqxly

Motivation

https://mui.com/joy-ui/react-input/#floating-label

Search keywords: select input slot

@atillaaliyev atillaaliyev added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 24, 2024
@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 24, 2024
@atillaaliyev atillaaliyev reopened this Apr 24, 2024
@atillaaliyev atillaaliyev changed the title [joy-ui][Select] Access input slot [joy-ui][Select] Floating label Select Apr 24, 2024
@atillaaliyev atillaaliyev reopened this Apr 24, 2024
@zannager zannager added component: select This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 24, 2024
@yamahmed
Copy link

I just checked the code provided here https://mui.com/joy-ui/react-input/#floating-label and i suggest modifying 3 things :
1)Add a transition for the opacity of the placeholder text in the StyledInput component.
2) Adjust the label color on focus to match the focused highlight color.
3)Use theme palette for the label color and theme typography for the font weight in the StyledLabel component.

i'll provide a screenshot of where to modify:

Capture d’écran 2024-04-28 142802

@atillaaliyev
Copy link
Author

I just checked the code provided here https://mui.com/joy-ui/react-input/#floating-label and i suggest modifying 3 things : 1)Add a transition for the opacity of the placeholder text in the StyledInput component. 2) Adjust the label color on focus to match the focused highlight color. 3)Use theme palette for the label color and theme typography for the font weight in the StyledLabel component.

i'll provide a screenshot of where to modify:

Capture d’écran 2024-04-28 142802

I haven't StyledInput component, because mui joy uses button instead of input or select. But I tried anyway , it didn't work.

@yamahmed
Copy link

What if we need to adjust the styling component accordingly to a button instead of a Select or input component?
i think this will work

@atillaaliyev
Copy link
Author

atillaaliyev commented Apr 29, 2024

Could you send me codesandbox link after do it? Because, it didn't work.

@ZeeshanTamboli
Copy link
Member

Why transition in this manner in the first place? The Select doesn't have an input; it uses a button. Plus, there's no placeholder or cursor when focused, so this transition doesn't seem valid to me.

@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 14, 2024
@atillaaliyev
Copy link
Author

Why transition in bu şekilde in the first place? The Select doesn't have an input; it uses a button. Plus, there's no placeholder or cursor when focused, so this transition doesn't seem valid to me.

I shared my motivation in first post : https://mui.com/joy-ui/react-input/#floating-label. I know all of your says. But I'm preparing component series with mui joy infrasturcuture for my company and we will use these components with floating label some projects, These components are TextField, DatePicker, DateTimePicker, TimePicker, AutoComplete, Select etc. If you say Joy select does not do it, maybe you can edit your code to enable it, like this : https://codepen.io/arjdev/pen/NWqNoaw?editors=1100

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented May 17, 2024

If you say Joy select does not do it, maybe you can edit your code to enable it, like this : https://codepen.io/arjdev/pen/NWqNoaw?editors=1100

But what we render is a button and not a select with options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

No branches or pull requests

5 participants