Commit 97f9d601 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'fix-safari-clone-url' into 'master'

Fix clone URL losing selection after a single click in Safari and Chrome

### What does this MR do?

This MR deactivates the mouseup event in the `git clone` URL to prevent the text from being deselected after a single click.

### Why was this MR needed?

In Safari and Chrome 43.0.2357.65 (42.0.2311.152 worked fine), the URL would lose selection after a single click. To reproduce:

1. Go to https://gitlab.com/gitlab-org/gitlab-ce
2. Click on the URL in the repository (HTTP is selected by default).
3. Click on the SSH button.
4. Click on the URL again.

The URL selection should be selected automatically, but it is deselected immediately.

It appears that 92544df8 changed the selection event from `click` to `focusin` to make copy & paste work in X11. This Stack Overflow article discusses the deselection issue in detail:

http://stackoverflow.com/questions/3380458/looking-for-a-better-workaround-to-chrome-select-on-focus-bug

### What are the relevant issue numbers?

Closes https://github.com/gitlabhq/gitlabhq/issues/9326

See merge request !698
parents 106cb511 310e08dc
......@@ -9,6 +9,7 @@ v 7.12.0 (unreleased)
- Add web hook support for note events (Stan Hu)
- Disable "New Issue" and "New Merge Request" buttons when features are disabled in project settings (Stan Hu)
- Remove Rack Attack monkey patches and bump to version 4.3.0 (Stan Hu)
- Fix clone URL losing selection after a single click in Safari and Chrome (Stan Hu)
- Allow to configure location of the `.gitlab_shell_secret` file. (Jakub Jirutka)
- Disabled expansion of top/bottom blobs for new file diffs
- Update Asciidoctor gem to version 1.5.2. (Jakub Jirutka)
......
......@@ -116,7 +116,10 @@ window.addEventListener "hashchange", shiftWindow
$ ->
# Click a .js-select-on-focus field, select the contents
$(".js-select-on-focus").on "focusin", -> $(this).select()
$(".js-select-on-focus").on "focusin", ->
# Prevent a mouseup event from deselecting the input
$(this).select().one 'mouseup', (e) ->
e.preventDefault()
$('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment