-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Migrate CreateDashboardDialog to React #3826
Migrate CreateDashboardDialog to React #3826
Conversation
} | ||
}, 100); | ||
return () => clearTimeout(timer); | ||
}, []); |
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 think you can substitute this for <Input autofocus />
, no?
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 does not work in modals. This fix was suggested in related discussion
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.
Weird, it seems to work on CreateSourceDialog
and ChangePasswordDialog
🤔
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.
@gabrieldutra I'll check once more
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.
@gabrieldutra I see that autoFocus
works in other modals, but it doesn't work in this one - I really have no idea what's wrong 🤔 I tried to simplify that dialog as much as I can - removed almost all attributes, <DynamicComponent>
, etc. - just <Modal ...><Input autoFocus /></Modal>
- input does not get focused.
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.
There's one significant difference - Class component vs Functional component 🤔
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.
@ranbena Interesting idea. I'll try to implement it as class component - will see what happens.
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.
@ranbena Tried class component - the same issue (no autofocus).
Upd.: When this dialog is opened from React code - Input gets autofocus, when from Angular - no. I'll add a comment with ANGULAR_REMOVE_ME
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.
When this dialog is opened from React code - Input gets autofocus, when from Angular - no.
Makes sense and also good to know this sort of thing happens 🤔
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.
Yeah... But usually applications are built using only one framework, so such shit does not happen 🙂
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 awesome, great code 🤟🤟
Left two comments.
What type of PR is this? (check all applicable)
Description
Migrate CreateDashboardDialog to React. Restore some
DynamicComponent
usages (missed during React migration).Mobile & Desktop Screenshots/Recordings (if there are UI changes)