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

VERIFIED FIXED in Future

Status

()

Core
Layout: Form Controls
P3
normal
VERIFIED FIXED
18 years ago
16 years ago

People

(Reporter: Blake Ross, Assigned: rods (gone))

Tracking

Trunk
Future
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
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.
(Assignee)

Comment 1

18 years ago
I thought I fixed this too....
Summary: Can still select disabled listbox items → [LST]Can still select disabled listbox items
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

18 years ago
Target Milestone: --- → Future
(Assignee)

Updated

18 years ago
Priority: P3 → P1
Summary: [LST]Can still select disabled listbox items → [MUSTFIX][LST]Can still select disabled listbox items
Target Milestone: Future → ---
(Assignee)

Comment 2

18 years ago
*** Bug 57583 has been marked as a duplicate of this bug. ***
(Assignee)

Updated

18 years ago
Summary: [MUSTFIX][LST]Can still select disabled listbox items → [MF][LST]Can still select disabled listbox items
(Assignee)

Comment 3

18 years ago
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

Comment 4

18 years ago
sr=buster
(Reporter)

Comment 5

18 years ago
r=blake
(Assignee)

Comment 6

18 years ago
Fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

18 years ago
Still broken for me with the patch...(?)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 8

18 years ago
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
(Assignee)

Comment 10

18 years ago
fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → FIXED

Comment 11

18 years ago
VERIFIED using Mac 12-22-12 and Linux 12-19-08.
Status: RESOLVED → VERIFIED
(Reporter)

Comment 12

18 years ago
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 → ---
(Assignee)

Comment 13

18 years ago
Created attachment 21694 [details]
reduced testcase
(Assignee)

Comment 14

18 years ago
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
(Assignee)

Comment 15

18 years ago
Created attachment 21695 [details] [diff] [review]
patch for pressing first letter and it going to disabled item

Comment 16

18 years ago
sr=buster
(Assignee)

Comment 18

17 years ago
I need to check this in
Target Milestone: --- → mozilla0.9
Setting milestone to mozilla0.8.1
Target Milestone: mozilla0.9 → mozilla0.8.1

Comment 20

17 years ago
QA Contact Update
QA Contact: bsharma → vladimire
(Assignee)

Comment 21

17 years ago
fixed
(Assignee)

Comment 22

17 years ago
try this again - fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago17 years ago
Resolution: --- → FIXED

Comment 23

17 years ago
Verifying on build 2001-03-29-04-Mtrunk
Status: RESOLVED → VERIFIED
(Reporter)

Comment 24

17 years ago
/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 → ---

Comment 25

17 years ago
Should this be retargeted for 0.9 ???
(Assignee)

Comment 26

17 years ago
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
(Assignee)

Updated

16 years ago
Priority: P1 → P3
This has been fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago16 years ago
Resolution: --- → FIXED
(Bug 34297 was the one that fixed it.)

Comment 29

16 years ago
Verifying on build 20020807
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.