question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

QEditor loses caret after clearing model

See original GitHub issue

Describe the bug Clearing / refocusing to QEditor no longer works as it used to

Codepen/jsFiddle/Codesandbox (required) https://codepen.io/dsl101/pen/gOrdNJO

To Reproduce Steps to reproduce the behavior:

  1. Go to codepen
  2. Open console pane
  3. Enter some text into the QEditor, then hit CTRL+Enter
  4. The text is logged, cleared, but focus does not stay in QEditor

Expected behavior This code is lifted from a large application, and used to work, but in the last few weeks (months? not 100% certain when it stopped to be honest), the cursor is not positioned where it should be, and the QEditor is no longer ready for the next input. Sometimes the cursor is positioned right over to the far right of the component, sometimes it’s not visible at all.

Platform (please complete the following information): OS: Windows 10 Node: 12.16.2 NPM: 6.14.1 Yarn: 1.21.1 Browsers: Firefox, Safari, Chrome iOS: 13

Additional context Note that the call to focus() perhaps used to mask the (potential) real issue of clearing the model? At the moment, the behaviour is the same with or without the focus() call.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dsl101commented, Oct 20, 2020

Can confirm this has fixed the QEditor issue I had. @emahuni if you’re using (for example) an appended button to clear the input model, that button will take the focus, and you must explicitly set the focus back—that’s not a bug.

0reactions
hawkeye64commented, Oct 20, 2020

@emahuni It’s not the same. QEditor deals with range selections, cut/copy/paste, etc. This is where the bug came into play…trying to restore the caret to a position that no longer existed. If you feel QInput on has a bug, please make a codepen and open a new issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

QEditor loses caret after clearing model - Bountysource
QEditor loses caret after clearing model · 1. Go to codepen · 2. Open console pane · 3. Enter some text into the...
Read more >
tinymce loses caret position - Stack Overflow
I have a tinymce custom button, which toggles an emoticons div beside a textarea. onclick : function() { ed.focus(); $('#my- ...
Read more >
Quasar v1.14.2 released | Quasar Framework Community
... fix(QEditor): q-editor model not always updating display (#7869); fix(QEditor): QEditor loses caret after clearing model (#7790); fix(TS): date.
Read more >
Quasar Framework/CHANGELOG and Quasar Framework Releases ...
... fix(QEditor): q-editor model not always updating display (#7869); fix(QEditor): QEditor loses caret after clearing model (#7790); fix(TS): date.
Read more >
2. Editor Coordinates System. Positions and Offsets
Every caret has a set of properties describing its position in one of ... the editor and caret model. update() validated editor's existence....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found