-
Notifications
You must be signed in to change notification settings - Fork 839
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
[EuiFieldText] Prevent onChange
event on disabled inputs
#8271
Conversation
Looking for feedback at this point, no rush to merge. |
@tkajtoch if you don't like syncing the |
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'm happy with this change. Could you please add a changelog item and a JSDoc comment to readOnly
prop to let users know it defaults to the value of disabled
now?
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.
LGTM! I'll merge it after today's EUI release
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
Summary
This alters the behavior of the
EuiFieldText
to prioritizedisabled
styling overreadonly
, the same as native HTMLinputs
.Additionally, the
disabled
attribute does not preventonChange
events from firing. To counteract this behavior, we default thereadonly
attribute to the value ofdisabled
unless it is explicitly set. Withreadonly
set totrue
, theonChange
event is prevented. Alternatively, we could conditionally call theonChange
handler manually.These changes were tested in kibana ftr in elastic/kibana#206372 with no failing tests.
Closes #8239
QA
General checklist