Creating custom/pattern protected branch jumping scroll to top
Summary
Creating custom/pattern protected branch jumps your scroll position to the top of the page
Steps to reproduce
- Visit
group/some-project/settings/repository
- Scroll to the "Protected Branches" section
- Click the "Branch" select box and enter your own pattern like
protected-*
- Click the "Create wilcard protected-*" button
- Notice how you are scrolled to top and have a empty hash fragment
#
in the URL
What is the current bug behavior?
When creating a protected branch pattern, you are scrolled to top and have a empty hash fragment #
in the URL
What is the expected correct behavior?
Clicking "Create wildcard ..." won't move the scroll position
Output of checks
This bug happens on GitLab.com
Possible fixes
e.preventDefault();
- Use
button
element over a<a href="#">