-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
feat(editable-title): move cursor and scroll to the end #15270
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15270 +/- ##
=======================================
Coverage 77.26% 77.26%
=======================================
Files 971 971
Lines 50308 50313 +5
Branches 6140 6141 +1
=======================================
+ Hits 38869 38874 +5
Misses 11235 11235
Partials 204 204
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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, thanks for the fix!
const { length } = contentRef.current.value; | ||
contentRef.current.setSelectionRange(length, length); | ||
contentRef.current.scrollLeft = contentRef.current.scrollWidth; | ||
contentRef.current.scrollTop = contentRef.current.scrollHeight; |
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.
Not sure if this is needed (setting scrollTop
), but it probably doesn't hurt, either
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.
Cool. Here I think it need to scroll to the bottom for the textarea.
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.
Cool. Here I think it need to scroll to the bottom for the textarea.
Right you are! 👍
SUMMARY
This PR improves the UX of editable title component. Move the cursor and scroll to the end when focusing, for easier delete.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before
Screen.Recording.2021-06-11.at.6.09.02.PM.mov
after
2021-06-19.7.09.10.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION