medialab / fonio

a collaborative scholarly text editor allowing to build static websites
https://fonio.medialab.sciences-po.fr/demo
GNU Affero General Public License v3.0
67 stars 6 forks source link

troubles in cursor and focus (related with saving process ?) #335

Open paulgirard opened 4 years ago

paulgirard commented 4 years ago

Describe the bug

While writting in editor, the saving process has an impact on the focus. Two reports in one cause not the same issue in Firefox and in chrome.

To Reproduce

in Firefox 77.0.1 (64 bits) linux mint :

  1. add two lines of texts
  2. click outside the editor to focus on main page
  3. click back in the editor and suppress some characters in the second line
  4. the cursors jumps to start of line

No exception in console.

in Chrome 83.0.4103.97 (Build officiel) (64 bits) linux mint :

  1. write something
  2. wait for end of save operation
  3. type something, nothing happen cause the editor lost focus
  4. there is an exception in console (see below)

I couldn't reproduce this in a new section other than the ones I created for my story in the first place. @robindemourat I can give you access to my story if needed. The exception displayed when bug in chrome :

bundle.js:1 Uncaught TypeError: Cannot read property 'getIn' of undefined
    at e.exports (bundle.js:1)
    at e.exports (bundle.js:1)
    at e.exports (bundle.js:1)
    at e.exports (bundle.js:1)
    at bundle.js:1
    at Ls (bundle.js:1)
    at unstable_flushControlled (bundle.js:1)
    at bundle.js:1
    at Object.<anonymous> (bundle.js:1)
    at f (bundle.js:1)

Expected behavior

Cursor an focus should be stable.

robindemourat commented 4 years ago

Thanks, this is a known (not-so-sporadic) bug for firefox. Probably related to https://github.com/peritext/scholar-draft/issues/30 / to fix in upstream scholar-draft

paulgirard commented 4 years ago

I confirm it's not sporadic at all even in Chrome (lost of focus). It's actually pretty painful. Although it's a bit cavalier I do +1 my own issue :)