Closed Bug 22264 Opened 26 years ago Closed 26 years ago

Enabling GFX text field after disable does not work properly in mousewheel pref panel

Categories

(Core :: XUL, defect, P3)

x86
Windows 95
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: bugs, Assigned: saari)

Details

(Whiteboard: [PDT+] asked ben for helping verifying fix)

Take the following code designed to work on a text field and a checkbox: <html:input type="checkbox" id="checkboxID" onclick="toggleField();"/> <html:input type="text" id="fieldID"/> function toggleField() { var field = document.getElementById("fieldID"); var check = document.getElementById("checkboxID"); if( check.checked ) field.removeAttribute("disabled","true"); else field.setAttribute("disabled","true"); } this code should enable the textfield when the checkbox is checke, and disable the textfield when the checkbox is unchecked. Disabling works fine. Enabling on the other hand works oddly. The field isn't immediately available to be clickable (behaving like a disabled checkbox) however (on Win32) after the window loses focus and regains it, the field is clickable. On Linux this doesn't happen, the field remains disabled. There's something wacky here..
Sorry, on Linux this *does* happen (with the field beign enabled when the window loses and regains focus).
Assignee: trudelle → saari
Sounds like a focus issue, assigning to saari, cc hyatt & beppe
I did some preliminary debugging of this. It looks like what is happening is, in nsEventStateManager::PreHandleEvent, the NS_GOTFOCUS event is being thrown away (or at least, not processed in PreHandleEvent) because gLastFocusedDocument==mDocument. What I see is, when the text control successfully gets focus, there is one NS_GOTFOCUS event processed, and two thrown away. When it does NOT get focus (i.e. when the bug exhibits itself), I see 3 NS_GOTFOCUS events being thrown away.
Status: NEW → ASSIGNED
Target Milestone: M14
Hey cool, I think this is a dup of another bug I'm working on, but I'm not 100% sure yet so I'm leaving this open.
Keywords: beta1
Putting on pdt+ radar for beta1.
Whiteboard: [PDT+]
In nsHTMLInputElement::SetFocus there was a short circuit if the text field was disabled. While this makes sense logically, it confused the focus code by not completeing the circuit and focus state got out of whack. Always completing the circuit does the right thing. Marking Fixed.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
ben does this work for you now?
Whiteboard: [PDT+] → [PDT+] asked ben for helping verifying fix
You can test this in the mousewheel prefs panel. If you check the "System default" box, the "number of lines" field should disable; then if you uncheck it, it should re-enable.
this appears to still be busted (mousewheel pane). saari, if you like I can come and show you exactly where this is happening, or demo on this machine. What's interesting is that this isn't affecting the proxies panel, where similar code is present... (changing summary line)
Summary: Enabling GFX text field after disable does not work properly. → Enabling GFX text field after disable does not work properly in mousewheel pref panel
Re-opening since this doesn't appear fixed per ben's comments
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I just tested the mousewheel prefs panel using linux, and it works fine for me. Could be all the focus checkins we did today, I suggest you try again. Marking worksforme
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → WORKSFORME
it does seem to work now!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.