Closed Bug 57580 Opened 24 years ago Closed 22 years ago

[FIX][MF][LST]Can still select disabled listbox items

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: bugzilla, Assigned: rods)

References

()

Details

Attachments

(2 files)

Build ID: new trunk

Steps to Reproduce:

(1) Debug > Viewer Demos > #8 Form (resource:///res/samples/test8.html)
(2) Scroll down to where it says "Disabled Option Test"
(3) In the "Select size=4 with Disabled option (Listbox)" listbox, click the 
disabled "Two" item.  It doesn't get selected, as expected.
(4) Now select the "One" item and drag downwards, with the left mouse button 
still down.

Result: You can still select the "Two" item while the mouse button is down.  
Desirable behavior is that selection passes right over that item and goes to 
the next non-disabled (enabled) item, as if the disabled item(s) wasn't even 
there, and as we do in <optgroup> labels.
I thought I fixed this too....
Summary: Can still select disabled listbox items → [LST]Can still select disabled listbox items
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Priority: P3 → P1
Summary: [LST]Can still select disabled listbox items → [MUSTFIX][LST]Can still select disabled listbox items
Target Milestone: Future → ---
*** Bug 57583 has been marked as a duplicate of this bug. ***
Summary: [MUSTFIX][LST]Can still select disabled listbox items → [MF][LST]Can still select disabled listbox items
Simple fix, all I have to do is remove a line that shouldn't be there.

Patch:

Index: nsListControlFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/forms/src/nsListControlFrame.cpp,v
retrieving revision 1.170
diff -u -r1.170 nsListControlFrame.cpp
--- nsListControlFrame.cpp	2000/10/28 22:14:50	1.170
+++ nsListControlFrame.cpp	2000/12/18 19:55:56
@@ -2895,7 +3051,6 @@
       mButtonDown = PR_FALSE;
       CaptureMouseEvents(mPresContext, PR_FALSE);
       SetContentSelected(mSelectedIndex, PR_FALSE);
-      mSelectedIndex = kNothingSelected;
       return NS_OK;
     }
   }
Summary: [MF][LST]Can still select disabled listbox items → [FIX][MF][LST]Can still select disabled listbox items
sr=buster
r=blake
Fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Still broken for me with the patch...(?)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blake, you were right. The fix I just checked in fixed 57583, but this bug. I 
didn't read it close enough about the "drag" part, my fault. Bummer.

Here is the patch that fixes both:
Index: nsListControlFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/forms/src/nsListControlFrame.cpp,v
retrieving revision 1.171
diff -u -r1.171 nsListControlFrame.cpp
--- nsListControlFrame.cpp	2000/12/18 21:36:01	1.171
+++ nsListControlFrame.cpp	2000/12/18 23:22:51
@@ -2890,11 +2890,13 @@
       if (IsInDropDownMode() == PR_TRUE && mComboboxFrame) {
         ResetSelectedItem();
         mComboboxFrame->ListWasSelected(mPresContext, PR_FALSE); 
-      } 
+      } else {
+        SetContentSelected(mSelectedIndex, PR_FALSE);
+        mSelectedIndex = kNothingSelected;
+      }
       REFLOW_DEBUG_MSG(">>>>>> Option is disabled");
       mButtonDown = PR_FALSE;
       CaptureMouseEvents(mPresContext, PR_FALSE);
-      SetContentSelected(mSelectedIndex, PR_FALSE);
       return NS_OK;
     }
   }


The bottom line here is the line I removed with the last patch still needed to 
be there. But that line plus SetContentSelected line needed to only be executed 
when it wasn't in dropdown mode.

I probably added those two lines in to fix ListBoxes and didn't realize I was 
breaking comboboxes. So now they are both fixed.
Status: REOPENED → ASSIGNED
Patch looks good.
r=kmcclusk@netscape.com
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
VERIFIED using Mac 12-22-12 and Linux 12-19-08.
Status: RESOLVED → VERIFIED
This still isn't fixed.  I think I may have been unclear in my original report 
(because this isn't really a MUSTFIX issue)...
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Attached file reduced testcase
The only bug I can find with this, is if I hit the letter "T" in either list it 
will go to the disabled "Two" item. And I think this is a must fix.
Status: REOPENED → ASSIGNED
sr=buster
I need to check this in
Target Milestone: --- → mozilla0.9
Setting milestone to mozilla0.8.1
Target Milestone: mozilla0.9 → mozilla0.8.1
QA Contact Update
QA Contact: bsharma → vladimire
fixed
try this again - fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Verifying on build 2001-03-29-04-Mtrunk
Status: RESOLVED → VERIFIED
/me bangs head against the wall

This isn't fixed!  The bug is that the item still selects if you mouse down on, 
say, an item above it and move the cursor downwards while holding the 
mousebutton.  A minor bug, sure, but it still exists ;-)

Feel free to bother Ian if you need further explanation of it.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Should this be retargeted for 0.9 ???
On 1/3/01 I asked for an explanation for what was wrong and couldn't figure 
it out. Ok, now I know what else to fix.

Futuring
Status: REOPENED → ASSIGNED
Target Milestone: mozilla0.8.1 → Future
Priority: P1 → P3
This has been fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago22 years ago
Resolution: --- → FIXED
(Bug 34297 was the one that fixed it.)
Verifying on build 20020807
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: