Data explorer editor not keeping cursor position

Priority/Severity: low-medium?

Platform: Tested in Firefox. discourse data explorer plugin starting from commit d31d899 - Aug 27, 2024.

Description:
When editing in the data explorer editor, the cursor position is not remembered between each content change, and is moved to the start of the editor.

Reproducible steps:

  1. ensure data explorer plugin is updated to latest
  2. go to data explorer in admin page
  3. create a new query
  4. attempt to change the query in the editor

Initial Analysis:
This seems to be caused by the following commit, which adds an @onChange event hook that mutates the sql query content, causing the @content prop to update with new content.

Rolling back to before the above commit in a dev env, the editor interacted normally.

3 Likes

Thank you for this excellent bug report, we will get it sorted over the next week!

4 Likes

What’s your Discourse version? It does seem to work correctly with the latest core commit, and should work with any tagged version (incl. the latest v3.4.0.beta1)

1 Like

The initial report was tested in 3.4.0.beta1-dev ( 9d5eb6fed6 )

Updating Discourse to the latest commit 3.4.0.beta2-dev ( 7b89fdead9 ), it works properly.

4 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.