feat(zoom-scroll): config to disable requiring focus #1008
+54
−5
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.
Proposed Changes
Adds a
zoomScrollconfig optionneedsFocus. When set tofalse, focus of the canvas is no longer required to zoom/scroll. The default value istrue, thus retaining the previous behavior.Context: We have an app consisting of a full-screen BPMN modeler with a properties panel next to it. After clicking into the properties panel, users should not need to click on the modeler again to allow scrolling/zooming in it.
I've tested this patch in our app, to confirm that it works as expected.
Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool (since the new default is backwards-compatible with old behavior, you'd need to addzoomScroll: { needsFocus: false }to the config)