Open greenStone83 opened 1 year ago
This a great bug report!
I found where in the code the "0/4"
gets set:
https://github.com/processing/p5.js-web-editor/blob/9073487232b5f53756c3525981e992cee0fcd0fc/client/utils/codemirror-search.js#L456-L459
I'm kind of surprised that none of it is React. The text of the DOM element is manually changed when the findNext
function is called. I would have to dig into this more to fix it, as I'm not familiar with CodeMirror. I suspect that some of these issues of outdated state could be resolved by generating the search bar markup in React, even if we still have to use react-dom/renderToString()
to pass it the CodeMirror openDialog
. But I'm not sure that it's even necessary to handle the dialog through CodeMirror, vs. passing the CodeMirror instance as a prop to a React component.
Possibly related to #2081
p5.js version: 1.5.0
Web browser and version: Chrome, Firefox, and Edge, most recent
Operating System: Windows 11
https://editor.p5js.org/greenStone83/sketches/IQMmFIkYv