-
Notifications
You must be signed in to change notification settings - Fork 31
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
WRR-1063: Add optional options.preventScroll
parameter to focus
function to prevent scroll by focus
#3277
base: develop
Are you sure you want to change the base?
Conversation
Enact-DCO-1.0-Signed-off-by: Nakjun Hwang <[email protected]>
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek ([email protected])
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3277 +/- ##
========================================
Coverage 82.30% 82.30%
========================================
Files 152 152
Lines 7091 7091
Branches 1867 1867
========================================
Hits 5836 5836
Misses 985 985
Partials 270 270 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek ([email protected])
packages/spotlight/CHANGELOG.md
Outdated
|
||
### Changed | ||
|
||
- Renamed `spotlight` an optional `containerOption` parameter of `focus` function to `options` to avoid misunderstandings |
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.
Is this changelog necessary? Developers doesn't specify the parameter's name when they call Spotlight.focus.
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 thought the same manner at first time but we already mentioned containerOption
twice in changelogs. I wanted to remove this log honestly.
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.
Well, removed. At least both of us do not want it. ;)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek ([email protected])
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek ([email protected])
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
Checklist
Issue Resolved / Feature Added
Spotlight.focus
API does not supportpreventScroll
option so that apps need to handlefocus
event separately when they need to handle focusing for its own UX.In normal cases, the focus should be stay in visible area for users so that scrolling by focus is natural behavior. But if apps need to handle focus moving not for visual effect but for any other business logic, they may want to prevent scroll by focus. We'd like to support these cases.
Resolution
Spotlight.focus
calls the standardfocus
API internally, so updated our API to pass the option to the standard API.Spotlight.focus
already has options calledcontainerOption
so updated this option parameter like below.containerOption
tooptions
in documents to avoid misunderstandingpreventDefault
Additional Considerations
This PR contains the original commit from #3177 and some more code refinements. Refer the original PR for the original contribution.
Links
WRR-1063
#3177 (The original contribution)
Comments
Enact-DCO-1.0-Signed-off-by: Nakjun Hwang ([email protected])
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek ([email protected])