Skip to content

Commit

Permalink
#1679 remove autofocus on click
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariia-Katkova committed Jul 4, 2022
1 parent 1736d9a commit 9f09e38
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ClipArea extends Component {
el === event.target ||
(!isActiveElement(event.target) && this.props.focused())
)
autofocus(el)
autoselect(el)
},
mousedown: (event) => {
if (event.shiftKey && !isActiveElement(event.target))
Expand Down Expand Up @@ -104,9 +104,8 @@ function isActiveElement(el) {
return ['INPUT', 'SELECT', 'TEXTAREA', 'OPTION', 'LABEL'].includes(el.tagName)
}

function autofocus(cliparea) {
function autoselect(cliparea) {
cliparea.value = ' '
cliparea.focus()
cliparea.select()
}

Expand Down

0 comments on commit 9f09e38

Please sign in to comment.