Combobox readonly #7293
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Since Mantine leverages readonly (the HTML attribute) in this way (which makes a lot of sense), you can't really repurpose it. But I really like having a "readonly" state for my edit controls -- unlike disabled, readonly allows selection (for copy/paste, for example), which I think is better UX. So I extend the Mantine controls like this:
Then I can add global css rules that target data-readonly:
|
Beta Was this translation helpful? Give feedback.
-
Unless I am not implementing/using the component properly, there is a readOnly (optional) prop for the combobox that determines if a value can be changed, but it does not seem to be implemented. If I add readOnly in the snippet below, the readOnly prop does not prevent a click on the target to open the dropdown (it should prevent click event on its child component or something).
Was that known ? I don't see any style associated with a readOnly combobox either in its module.css
I don't mind looking into a PR to create so that we can have a functional readOnly
Beta Was this translation helpful? Give feedback.
All reactions