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)
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.
Comment 1•12 years ago
|
||
This does seem like a gecko bug. CCing bz for consultation, who apparently knows everything there is to know about anything.
Comment 2•12 years ago
|
||
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">
Comment 3•12 years ago
|
||
(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/
Comment 4•12 years ago
|
||
Is this perhaps specific to <xul:textbox>? A small testcase in extension form would be pretty helpful...
Reporter | ||
Comment 5•12 years ago
|
||
(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.
Reporter | ||
Comment 6•12 years ago
|
||
Run this https://gist.github.com/e1299371b9f5b06c3913 in a Scratchpad (browser environment).
Comment 7•12 years ago
|
||
> 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...
Comment 8•12 years ago
|
||
(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.
Reporter | ||
Comment 9•12 years ago
|
||
(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?
Updated•12 years ago
|
Component: Developer Tools: Debugger → Editor
Product: Firefox → Core
Comment 10•12 years ago
|
||
cc-ing ehsan for some consultation.
filter on CHOCOLATE.
Comment 11•12 years ago
|
||
That's us being stupid. Aryeh, can you take a look at this please?
Comment 12•12 years ago
|
||
Comment 13•12 years ago
|
||
I won't have time to take a look at this.
Comment 14•12 years ago
|
||
(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!
Comment 15•12 years ago
|
||
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).
Updated•12 years ago
|
Blocks: Instantbird
Reporter | ||
Comment 16•12 years ago
|
||
(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 :)
Reporter | ||
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Comment 17•12 years ago
|
||
Benedikt, do you have steps to reproduce for Victor?
Flags: needinfo?(benediktp)
Comment 18•4 years ago
|
||
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.
Description
•