Closed Bug 44490 Opened 25 years ago Closed 24 years ago

Disabled widgets shouldn't steal focus

Categories

(Core :: XUL, defect, P3)

x86
Windows 98
defect

Tracking

()

RESOLVED FIXED
mozilla1.0

People

(Reporter: bugzilla, Assigned: saari)

Details

Build ID: 2000070208 Disabled widgets shouldn't be able to steal the focus. Such behavior is witnessed in the Find in this Page dialog -- if there's no text in the textfield and you click the disabled Find button, focus leaves the textfield.
saari, is this focus or just bad xul/css?
Assignee: trudelle → saari
Yes, a CSS issue, there should be a rule to set user-focus:ignore in the disabled rule for the widget. I could ad this check into EventStateManager as an alternative.
Would fixing it in EventStateManager fix it globally (and subsume the need to add the CSS rule)?
It would fix it globally, but it is of course a more limiting move. The most flexible way to fix it is in CSS. If I fix it in event state manager, then disabled things will never be able to get focus. <shrug>
I think it should be fixed globally...I'd imagine that most people will forget to add the css rule for the disabled state (esp. considering that even some NS devs forgot), and many will probably assume that by default disabled widgets do not steal focus. I agree that it's best to keep power in the hands of the developer (i.e. allow him to customize the style of widgets and widget states), but I think we need to define a basic, common set of characteristics for widgets and widget states. To me, at least, the fact that disabled widgets can't get focus is a standard rule (since they have no need to get focus). Because it seems to me to be more common, I feel that that should be the default behavior (and others can change it if they wish)
Oops -- rereading your comment, I realize now that in fixing the event state manager, there'll be no way for others to allow disabled widgets to have the focus if they so desire. I still think the change should be globally made, however (if there's no way to make user-focus: ignore a "default" rule of the button, but changeable)...I don't believe that people should have to go to extra trouble to make a standard widget behave as it does natively in pretty much every OS (afaik). John: your thoughts?
My small brain sez ... There aren't many situations where allowing a disabled element to get focus is desirable. However, I note that win32 native menu behaviour is that disabled menuitems get at least ':hover' (although I don't know if they actually get ':focus').' A second point is that most of the base focus behaviour for the core widget set is defined in xul.css and effectively inherited by anyone who was to, for example, redefine 'button' in a custom package. (Although, for new widget's that extend core widgets, the base set of style rules will not apply to the derived widget).
Target Milestone: --- → Future
saari, how hard is it to fix the event state manager? these are some basic but important focus issues.
Targeting mozilla 1.0
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla1.0
Good news - this appears to be fixed. I tried it on Linux, Win 2000 and Win98 and it works in all 3. Unless someone disagrees, let's take it off Saari's back.
Yeah, this is pretty much fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.