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

Default values don't seem to be displayed when using themes #3963

Closed
4 tasks done
benjdlambert opened this issue Nov 17, 2023 · 3 comments
Closed
4 tasks done

Default values don't seem to be displayed when using themes #3963

benjdlambert opened this issue Nov 17, 2023 · 3 comments

Comments

@benjdlambert
Copy link
Contributor

Prerequisites

What theme are you using?

material-ui

Version

5.x

Current Behavior

It looks like there's some issues with default values not being displayed properly when using some themes. The default theme and bootstrap themes work as expected, but it looks like the material-ui / mui themes don't render the default value correctly.

Expected Behavior

The default value renders in the input field

Steps To Reproduce

material-ui playground link

default theme playground link

Environment

Not relevant

Anything else?

Apologies if there's already an issue for this already, but don't think it's related to the already existing allOf if-then-else issues as this seems to be a theme issue rather than a core library problem?

@benjdlambert benjdlambert added bug needs triage Initial label given, to be assigned correct labels and assigned labels Nov 17, 2023
@heath-freenome heath-freenome added help wanted and removed needs triage Initial label given, to be assigned correct labels and assigned labels Nov 17, 2023
@heath-freenome
Copy link
Member

@benjdlambert Wow, this seems to be an issue with the SelectWidget implementation in the non-bootstrap themes. Thanks for finding it. Are you willing to debug the material-ui issue and let us know what you find? I'm guessing the bug is probably consistent across all themes?

@benjdlambert
Copy link
Contributor Author

benjdlambert commented Nov 18, 2023

@heath-freenome i can for sure dig around a little bit. Thanks for pointing in a direction on where to start!

And yep, seems the data is in the model but not rendered in the widget. I only tested both material and mui but I'm guessing there's other themes with this issue the fix is similar.

Will test with the other themes too.

@benjdlambert
Copy link
Contributor Author

@heath-freenome did some digging around, and it actually looks like this is just a symptom of #3892. The values are never added to the model, so what happens is that some of the themes have a placeholder for the first item in the list.

I will close this issue as a duplicate, and look at implementing that.

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

No branches or pull requests

2 participants