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