-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
check-storage-luks: Fixes for React #9355
check-storage-luks: Fixes for React #9355
Conversation
Element nesting structure has changed (<table> is followed by <tbody> instead of <tr>). Workaround for not-emitted onChange event when setting "value" attribute of <input> element directly. Works fine now but would be better to introduce a generic solution for that in a later patch.
Addition of |
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.
Looks OK to me, but I'd like @mvollmer to have a second look. Thanks!
# Workaround: React does not fire onChange event when setting input.value attribute directly | ||
# https://github.com/facebook/react/issues/8971 | ||
# potential fix: https://codepen.io/pudgereyem/live/OWBrdv | ||
def dialog_type_val(self, field, val): |
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.
The dialog_set_val
function needs to be able to handle all types of fields, as it is used also by the high-level dialog
and dialog_with_retry
functions. And unfortunately, it needs to handle both React and the old Mustache dialogs at the same time... Right now only check-storage-luks runs into React dialogs, but the goal is to change all dialogs to be implemented with React, and thus dialog
and dialog_with_retry
should be ready to work with them.
Does using React really change the behavior of the <input>
element so much? Could we maybe synthesize the onChange
event?
The changes related to the new |
It's common in our case. But DOM produced by React is not meant to be updated externally, like via JQuery. Not full list, but solution can be within:
Just setting Google can find many discussions on this, namely: [2] [1] https://codepen.io/pudgereyem/live/OWBrdv |
Ok, I think simulated typing is the way to go. I made #9394 for this, so I think we can close this here, right? |
@mvollmer , thanks. Works for me. |
Part of #9263 PR-split.
Element nesting structure has changed - (
<table>
is followed by<tbody>
instead of<tr>
).Workaround for not-emitted onChange event when setting "value"
attribute of element directly.
Works fine now but would be better to introduce a generic
solution for that in a later patch.