1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-27 08:31:20 +02:00

Fixed firefox incompatiblity

This commit is contained in:
Jesús Espino 2020-11-17 19:40:40 +01:00
parent f9a7a00ecc
commit 184b2f1b25

View File

@ -24,11 +24,11 @@ export default class Editable extends React.Component<Props> {
}
public focus(): void {
this.elementRef.current!.focus()
// Put cursor at end
document.execCommand('selectAll', false, undefined)
document.getSelection()?.collapseToEnd()
if (this.elementRef.current) {
const valueLength = this.elementRef.current.value.length
this.elementRef.current.focus()
this.elementRef.current.setSelectionRange(valueLength, valueLength)
}
}
public blur = (): void => {