A textbox with focus that is disabled and re-enabled by script loses it's caret.

RESOLVED FIXED in mozilla2.0b4

Status

()

defect
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: hwiechers, Assigned: mounir)

Tracking

unspecified
mozilla2.0b4
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking2.0 beta5+)

Details

Attachments

(1 attachment)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3

A textbox with focus that is disabled and re-enabled by script loses it's caret.

Reproducible: Always

Steps to Reproduce:
1. Create a new html page with this content 
<html>
    <head>
        <script type="text/javascript">
            window.onload = function() {
                input = document.getElementsByTagName('input')[0].onkeypress = function(e) {
                    if(e.keyCode == '13') {
                        this.setAttribute('disabled','true');
                        this.removeAttribute('disabled');
                    }
                }
            }
        </script>
    </head>
    <body>
        <p>Give the input below focus and push enter. The caret will disappear.</p>
        <input id="input" value="xyz" />
    </body>

</html>


2. Open the page
3. Tab to the textbox and press enter.
Actual Results:  
The caret disappears. The textbox appears to work correctly besides that. Tabbing out of the text box and going back to it seems to restore the caret.

Expected Results:  
The caret displays after the textbox is re-enabled.
This is a simpler way to test the bug:
data:text/html,<html><body onload="var i=document.getElementById('i'); i.focus(); i.disabled=true; i.disabled=false;"><input id='i'>

You can copy this data url into your address bar. When loaded, if you start typing, you will type into the text field but the caret will not show.
Status: UNCONFIRMED → NEW
Component: General → Layout: Form Controls
Ever confirmed: true
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → layout.form-controls
Hardware: x86_64 → All
Posted patch Patch v1Splinter Review
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attachment #463947 - Flags: review?(roc)
Attachment #463947 - Flags: approval2.0?
blocking2.0: --- → beta5+
Attachment #463947 - Flags: approval2.0?
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/14c1f2783543
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b4
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.