You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing a plugin on Kibana v7.7.0 tag, which is using elastic/eui v21.0.1.
I'm using the EuiSuperSelect component, which has a readOnly prop. If I set this prop to true, I can see the styling of the component change, removing the shadows, but I'm still able to change the value.
I have several other EUI components (such as EuiFieldText) that use the same readOnlyState variable, that all behave as expected.
<EuiSuperSelectreadOnly={readOnlyState}// <-- Changes style, but not functionvalueOfSelected={itemId}onChange={setItemId}// <-- This is called regardless of *readOnlyState*options={itemOptions}/>
Hi @mwswindle! I noticed this too pretty recently, thank you for making an issue.
The problem is that <select> HTML elements that this component is mimicking doesn't actually support readonly so it's actually more of a mistake to both
a. support the prop
b. apply the styles for it
It's more appropriate to use the disabled prop. Though it does beg the question whether or not we should "fake" a readonly state for our own components.
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
Activity
cchaos commentedon May 26, 2020
Hi @mwswindle! I noticed this too pretty recently, thank you for making an issue.
The problem is that
<select>HTML elements that this component is mimicking doesn't actually supportreadonlyso it's actually more of a mistake to botha. support the prop
b. apply the styles for it
It's more appropriate to use the
disabledprop. Though it does beg the question whether or not we should "fake" a readonly state for our own components.[-]EuiSuperSelect ignoring readOnly prop[/-][+][EuiSuperSelect] Ignores `readOnly` prop[/+]github-actions commentedon Mar 20, 2021
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
github-actions commentedon Sep 17, 2021
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
cchaos commentedon Sep 17, 2021
I think we should go ahead and support the
readOnlyprop in functionality as well as look. This means:truetrue.[EuiSelect] & [EuiSuperSelect] Update to new EuiFormControlLayout props
[Form controls] Added `alert` icon indicators for invalid state (#5738)