Skip to content

Commit

Permalink
enh: add user-select none to filename badge (#346)
Browse files Browse the repository at this point in the history
Add `user-select: none` on badge and icon to make sure
they are ignored when selecting the filename, so that when
double-clicking on a filename we now can select the same string
that this feature copies.

![image](https://user-images.githubusercontent.com/23088305/79253933-f5d43f80-7e51-11ea-9c57-08fa5d671e71.png)

`frontend/src/helpers/authorization/abilityActions.js ` (copied)

Closes #344
  • Loading branch information
jwallet committed Apr 20, 2020
1 parent 09cba87 commit 456730e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/insert-copy-filename/insert-copy-filename.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* fix ability to select filename correctly in a PR, removing Icon from being selected */
.filename span {
user-select: none;
}
2 changes: 2 additions & 0 deletions src/insert-copy-filename/insert-copy-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import { h } from 'dom-chef'

import './insert-copy-filename.css'

function onClick() {
const diff: HTMLElement = ((this: HTMLButtonElement).closest(
'.bb-udiff'
Expand Down

0 comments on commit 456730e

Please sign in to comment.