Move accountPassword out of the inner class component state, and move it out to the wrapping "Connected" functional component.
As part of the work to refactor ThreadSettingsModal… specifically to turn it into a functional component.
Depends on D3756
Differential D3757
[web] Move `accountPassword` state up from `ThreadSettingsModal` to `ConnectedThreadSettingsModal` Authored by atul on Apr 18 2022, 5:43 PM.
Details Move accountPassword out of the inner class component state, and move it out to the wrapping "Connected" functional component. As part of the work to refactor ThreadSettingsModal… specifically to turn it into a functional component. Depends on D3756 Close reading... should be a noop Will test the entirety of ThreadSettingsModal thoroughly once the refactor is complete (plan on using this as an opportunity to write some automated tests)
Diff Detail
Event Timeline
Comment Actions
Ah you're right, there's no guarantee that the input will be cleared by the time the input is focused. In practice there doesn't seem to be any issue with this approach and the experience remains smooth... but it might be good to introduce something like the useStateCallback hook described in the StackOverflow thread you attached for correctness/predictability. We're using an approach similar to the one in this diff for the LoginForm component, so there's at least one other place in the codebase where we should make similar changes. Made a Linear task to track the issue: https://linear.app/comm/issue/ENG-1023/[web]-explore-synchronously-focusing-inputs-after-state-has-been-set | ||||||||||