Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Form Provider Refactor] RoomNameInput fixes #32432
[Form Provider Refactor] RoomNameInput fixes #32432
Changes from 4 commits
28d0ba9
9fa1591
b9fc2f4
cc75622
02756ba
c56d3af
f54b326
abbca90
f0ac1bd
885ba8d
b750a6b
6e66e3f
06c1735
8c701f2
dd91de4
31f79a6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 don't think this is the best to do here. Using
InputWrapper
insideRoomNameInput
to wrapTextInput
feels a littler over-engineered. I would rather preferInputWrapper
to wrapRoomNameInput
.InputWrapper
should wrap the highest-level input.RoomNameInput > InputWrapper > TextInput
❌InputWrapper > RoomNameInput > TextInput
✅PS: We also have a problem with that structure on NewDatePicker
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.
It would look better if we have moved the
InputWrapper
outside the component, but that would require dividing the logic of RoomNameInput between the component and screens where it's used. Since the logic of room input is quite complex and the current refactor has already caused some regressions in this PR I would only migrate the input to FormProvider. As soon as we will be sure the current changes won't introduce any regressions I would refactor the RoomNameInput according your suggestions in a separate PR.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 trying to get rid of the
valueParser
anddisplayParser
that we are passing to the Form. TheFromProvider
should not handle those. We should instead call theonInputChange
in theRoomNameInput
and supply the modified value.This approach should result in the least code changes.
Can you please elaborate on this one?
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.
That would be great, but since we need to display different value than the one that is sent to Onyx, I couldn't find any better solution.
The second part I managed to move, I didn't spot that I forgot to move some props.
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.
This is already handled within
<RoomNameInput />
:value={value.substring(1)}
.Let's consider this scenario:
<RoomNameInput ... />
with<InputWrapper InputComponent={RoomNameInput} ... />
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.
@s77rt Ok, I reverted some changes, I think now it should look fine.
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.
Thanks. This is looking much better. I still see some changes to
src/components/RoomNameInput/
that does not look needed. And insrc/libs/RoomNameInputUtils.ts
too Can you please check again?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.
Will do it tomorrow
This file was deleted.