Closed Bug 779738 Opened 12 years ago Closed 12 years ago

Cutting text from textbox does not fire the input event

Categories

(Core :: DOM: Editor, defect)

12 Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: vporof, Unassigned)

References

Details

Attachments

(1 file)

(deleted), application/x-javascript
Details
STR: 1. Open debugger on http://htmlpad.org/debugger/ 2. Write the letter a in the Filter Scripts textbox 3. Select all the text in the textbox 4. Cut (cmd+q or via the menu) The scripts dropdown menu is not repopulated with all the scripts. PS: replace step 4 with 4. Delete (backspace) This works. PPS: doing `textbox.focus(); textbox.value = ""; ` doesn't fire an input event either, and I had to rely on selection events to handle this case in tests. However, this doesn't seem to cut it when cutting text.
This does seem like a gecko bug. CCing bz for consultation, who apparently knows everything there is to know about anything.
Which menu are we talking about? And why is Cmd-_Q_ cut? Nomal cut via the application meny (on Mac) or via Cmd-X seems to fire oninput just fine for me on this testcase: <!DOCTYPE html> <input value="Highlight part of the text and then cut" oninput="alert('uninput')" size="100">
(In reply to Boris Zbarsky (:bz) [In and out Aug 1 - 10, out Aug 11-20] from comment #2) > Which menu are we talking about? And why is Cmd-_Q_ cut? Nomal cut via the > application meny (on Mac) or via Cmd-X seems to fire oninput just fine for > me on this testcase: > > <!DOCTYPE html> > <input value="Highlight part of the text and then cut" > oninput="alert('uninput')" size="100"> I think Cmd-Q was a typo. Cmd-X is what I use to reproduce the behavior Victor describes in the debugger search box. You can see that after opening Tools -> Web Developer -> Debugger in the toolbar on top. Victor, I've put Boris's test here, and it works fine: http://htmlpad.org/debugger-filter-cut/
Is this perhaps specific to <xul:textbox>? A small testcase in extension form would be pretty helpful...
(In reply to Panos Astithas [:past] from comment #3) > (In reply to Boris Zbarsky (:bz) > > I think Cmd-Q was a typo. Yup, sorry, typo. (In reply to Boris Zbarsky (:bz) [In and out Aug 1 - 10, out Aug 11-20] from comment #4) > Is this perhaps specific to <xul:textbox>? A small testcase in extension > form would be pretty helpful... I'll get right to it.
Run this https://gist.github.com/e1299371b9f5b06c3913 in a Scratchpad (browser environment).
> in a Scratchpad (browser environment). How do I do that? It doesn't seem to work in just a chrome scratchpad (says gBrowser is undefined). For what it's worth, I just tried this XUL document in a file (after flipping the pref to allow XUL from file://): <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <textbox id="x" /> <script> var i = 0; document.getElementById("x").addEventListener("input", function(e) { console.log("input: " + (i++)); }, ); </script> </window> and it seems to work fine on cut...
(In reply to Boris Zbarsky (:bz) [In and out Aug 1 - 10, out Aug 11-20] from comment #7) > > in a Scratchpad (browser environment). > > How do I do that? It doesn't seem to work in just a chrome scratchpad (says > gBrowser is undefined). You need to select Environment -> Browser before running the code. > For what it's worth, I just tried this XUL document in a file (after > flipping the pref to allow XUL from file://): > > <window > xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> > <textbox id="x" /> > <script> > var i = 0; > document.getElementById("x").addEventListener("input", > function(e) { console.log("input: " + (i++)); }, > ); > </script> > </window> > > and it seems to work fine on cut... (Victor: note that there is a redundant comma after the event handler, and you need to set dom.allow_XUL_XBL_for_file) This is baffling me. I tried both test cases and Victor's doesn't fire an event, while Boris's does. I even tried removing the line that sets the value attribute in Victor's code, but it still doesn't fire.
(In reply to Panos Astithas [:past] from comment #8) > (In reply to Boris Zbarsky (:bz) [In and out Aug 1 - 10, out Aug 11-20] from > comment #7) > > (Victor: note that there is a redundant comma after the event handler, and > you need to set dom.allow_XUL_XBL_for_file) > Not my code. Anyway, I don't think it makes any difference. > This is baffling me. I tried both test cases and Victor's doesn't fire an > event, while Boris's does. I even tried removing the line that sets the > value attribute in Victor's code, but it still doesn't fire. Could it be that document.createElement("textbox") misbehaves?
Component: Developer Tools: Debugger → Editor
Product: Firefox → Core
cc-ing ehsan for some consultation. filter on CHOCOLATE.
That's us being stupid. Aryeh, can you take a look at this please?
Yeah, I can reproduce this with the steps from comment 6. Given comment 7, that's pretty confusing. I tried using a capturing input listener on the window, but that doesn't change the behavior.
I won't have time to take a look at this.
(In reply to Victor Porof [:vp] from comment #6) > Run this https://gist.github.com/e1299371b9f5b06c3913 in a Scratchpad > (browser environment). Unfortunately this gist is down. Could you maybe upload (or paste it elsewhere) again? I'd like to use it to test for another bug. Thanks in advance!
We ran into this bug in Instantbird: https://bugzilla.instantbird.org/show_bug.cgi?id=260#c5 Unfortunately I lack the necessary rights to mark this bug as blocking bug 596002 (Instantbird tracking bug).
Attached file test (deleted) —
(In reply to Benedikt P. [:Mic] from comment #14) > (In reply to Victor Porof [:vp] from comment #6) > > Run this https://gist.github.com/e1299371b9f5b06c3913 in a Scratchpad > > (browser environment). > > Unfortunately this gist is down. Could you maybe upload (or paste it > elsewhere) again? I'd like to use it to test for another bug. Thanks in > advance! I cannot reproduce this anymore with the steps described in comment #1 and comment #6. Maybe you're facing with a different variation of this bug? Anyway here's the code I used for testing. I'm marking this as WORKSFORME since, well, it seems to work now :)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Benedikt, do you have steps to reproduce for Victor?
Flags: needinfo?(benediktp)

I have no information to add here anymore. Clearing needinfo request.

Flags: needinfo?(benediktp)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: