Design View: Add small buffer to click-drag action
What does this MR do?
Previously, mousedown/up events were very sensitive to user clicks in Design View when zoomed in, and a comment form would not be opened when that was the user's intention. This is raised in #214599 (closed)
This MR adds a 2px buffer to click-drag events in Design View: the user must move their mouse 2px from the start position before we initiate the dragging action. In other words, click-and-drag "kicks in" after 2px; anything less and we open the comment form.
How to test
- Upload a design
- Click on the design (open it in Design View)
- Zoom in such that the design overflows (scrollbars appear)
- Click on the design to open a comment form - the form should open
- Click around a few more times - the comment form should always open (or be visible)
- Click-and-drag to move around the zoomed-in image - this should also work as expected
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
- [-] Code review guidelines
- [-] Merge request performance guidelines
- [-] Style guides
- [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖