Skip to content
Snippets Groups Projects
Commit ae17b4ad authored by chris's avatar chris
Browse files

fix firefox selection

parent 4f027cdf
No related branches found
No related tags found
1 merge request!501Translations
......@@ -23,7 +23,10 @@ export default props => {
}
setTimeout(() => {
widget.setAttribute('contenteditable', true);
if (navigator.userAgent.includes('Firefox')) {
if (
navigator.userAgent.includes('Firefox') &&
newState.selection.$from.nodeBefore == null
) {
widget.setAttribute('style', 'visibility:hidden');
} else {
widget.setAttribute('style', 'display:none');
......@@ -45,7 +48,10 @@ export default props => {
event.preventDefault();
const fakeCursor = document.getElementById('fake-cursor');
if (fakeCursor) {
if (navigator.userAgent.includes('Firefox')) {
if (
navigator.userAgent.includes('Firefox') &&
view.state.selection.$from.nodeBefore == null
) {
fakeCursor.style.visibility = 'hidden';
} else {
fakeCursor.style.display = 'none';
......@@ -61,7 +67,10 @@ export default props => {
} else {
const fakeCursor = document.getElementById('fake-cursor');
if (fakeCursor) {
if (navigator.userAgent.includes('Firefox')) {
if (
navigator.userAgent.includes('Firefox') &&
view.state.selection.$from.nodeBefore == null
) {
fakeCursor.style.visibility = 'visible';
} else {
fakeCursor.style.display = 'inline';
......
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