Devtools console autocompletion corrects perfectly reasonable code to nonsense
Categories
(DevTools :: Console, defect)
Tracking
(firefox79 fixed)
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: marijnh, Assigned: nchevobbe)
Details
Attachments
(3 files)
What were you doing?
Please tell us what site you were on, and what steps led to the error you are reporting
- Open the devtools console
- Type
x = {}
and press enter - Type
foo(x)
and press enter
What happened?
The closing parenthesis was replaced by x
What should have happened?
The input I type gets evaluated.
Assignee | ||
Comment 1•4 years ago
|
||
I wonder if you're hitting Bug 1624661.
Would you be able to check on Beta (78) if you can still reproduce this issue?
Reporter | ||
Comment 2•4 years ago
|
||
It exists in 78.0b4. Does it not occur for you?
Assignee | ||
Comment 3•4 years ago
|
||
Sadly no, I can't reproduce :/
Do you have the "autoclose brackets" setting turned on?
Could you attach a screencast so I can have a sense of the speed that's happening at and the order of operation?
We had a few weirdness with autocomplete (and fast typist), so we might still have issues.
Reporter | ||
Comment 4•4 years ago
|
||
Reporter | ||
Comment 5•4 years ago
|
||
Yes, autoclose brackets is on—and if I turn it off the problem goes away.
I've attached a screencast, but there's really nothing more going on than what I describe in the original issue. It'll complete over the closing paren when you press enter, though there's no completion dropdown visible anymore.
Reporter | ||
Comment 6•4 years ago
|
||
(Not sure what bugzilla's problem with the video is—when I download it mplayer plays it without trouble.)
Assignee | ||
Comment 7•4 years ago
|
||
okay, I think I'm able to reproduce, I'll investigate, thanks for the report and the information!
Assignee | ||
Comment 8•4 years ago
|
||
The console editor uses the codeMirror autoclose bracket addon,
which when the user types a closing bracket and the next char
in the input is the same char, won't insert a new char, but will
only move the cursor.
In such case, the JsTerm code wasn't capturing this key event, and
it could happen that the autocomplete would still be displayed,
which would then lead to some weirdness when the user hits Enter.
In order to fix that, we listen for the keyHandled event, which
is fired one a keypress was handled, and that appear that be fired
for the case I exposed, and isn't triggered when the character is
simply inserted.
A test case is added in one of our test to make sure this works as
expected.
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Description
•