Open
Bug 633130
Opened 15 years ago
Updated 3 years ago
opening an alert-box from a tab-handler does not get focussed
Categories
(Toolkit :: Content Prompts, defect)
Tracking
()
NEW
People
(Reporter: florian, Unassigned)
Details
Attachments
(1 file)
|
771 bytes,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b11) Gecko/20100101 Firefox/4.0b11
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b11) Gecko/20100101 Firefox/4.0b11
I try to open an alert box from an event listener that listens for the tab key on a particular input element. After pressing tab on the input element, the address bar gets focus, and pressing Enter reloads the page. Example see below.
<!doctype html>
<form action=other.html>
<input type=text id=input1>
</form>
<script>
document.getElementById('input1').addEventListener('keydown', checktab, false);
function checktab(evt) {
if(evt.keyCode === 9)
alert('Meldung');
}
</script>
Reproducible: Always
Steps to Reproduce:
1. Load the example.
2. Enter something in the input element.
3. Press Tab on the input element.
Actual Results:
Address bar gets focus. Pressing enter thus reloads the page. Inputs are lost.
Expected Results:
Alert box gets focus. Pressing enter dismisses the dialog.
In another more complex example enter will submit the form. I yet have to distill this one.
Regression Range :
works :
Mozilla/5.0 (Windows NT 6.1; rv:2.0b8pre) Gecko/20101119 Firefox/4.0b8pre
broken:
Mozilla/5.0 (Windows NT 6.1; rv:2.0b8pre) Gecko/20101120 Firefox/4.0b8pre
pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6478c1b83d60&tochange=baa6cc2f72e4
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Reporter | ||
Comment 2•15 years ago
|
||
Forget my comment about the other example, where the form is submitted. It was actually the same effect just with weirder URLs.
Comment 3•15 years ago
|
||
Related to Bug 617507?
| Reporter | ||
Comment 4•15 years ago
|
||
I have added another attachment.
Pressing Tab in the first input element will show the alert and focus the URL bar. After clicking the alert away focus is in the second input element.
Pressing Tab in the second element will again show the alert and focus the URL bar. After clicking the alert away focus is still in the second input element.
Pressing Tab in the third element will just cancel the Tab event. Nothing happens, URL bar is not focussed.
Clicking on the button will popup an alert, URL bar is not focussed.
=> The tab event does seem to be cancelled, but only _after_ the alert box was shown. What happens seems to be
1. show alert
2. evaluate tab event, thus focus URL bar
3. cancel tab event, if applicable
Comment 5•12 years ago
|
||
Bulk move to Toolkit::Notifications and Alerts
Filter on notifications-and-alerts-component.
Component: General → Notifications and Alerts
Product: Firefox → Toolkit
Updated•3 years ago
|
Severity: normal → S3
Updated•3 years ago
|
Component: Notifications and Alerts → Content Prompts
You need to log in
before you can comment on or make changes to this bug.
Description
•