WRR-1063: Add optional options.preventScroll
parameter to focus
function to prevent scroll by focus
#3277
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.
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 (wns450@gmail.com)
Enact-DCO-1.0-Signed-off-by: Seungcheon Baek (sc.baek@lge.com)