-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow SelectArrayInput to be variant=outlined #4511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase
c35b8ec
to
7d73684
Compare
const inputLabel = useRef(null); | ||
const [labelWidth, setLabelWidth] = useState(0); | ||
useEffect(() => { | ||
setLabelWidth(inputLabel.current.offsetWidth); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inputLabel.current can be null at mounting. Can you add a check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. the effect will run after the first render, and at that time, the ref will be defined.
Closes #4439
Issue
variant="outlined"
doesn't work onSelectArrayInput
Solution
Apply MUI method to build a valid Select with
variant="outlined"
Forked from MUI demo:
https://codesandbox.io/s/material-demo-684eu
Basic usage
ReferenceArrayInput usage
Screenshot