Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#18454 closed defect (fixed)

FilteringSelect Dropdown width

Reported by: Serge Owned by: bill
Priority: undecided Milestone: 1.9.8
Component: Dijit - Form Version: 1.10.3
Keywords: Cc:
Blocked By: Blocking:

Description

Problem relates to using a FilteringSelect? with a Memory store.

If the store's display value fits within the FilteringSelects? width, the dropdown size is the widgets width, as it should be (autoWidth = true).

If you then set the widgets store to a new store, with display values that are wider than the FilteringSelects? width, then the dropdown does not correctly resize. It retains the previous width.

This only works if the dropdown width is equal to the widgets width. If the dropdown width does not equal the widgets width, then autoWidth works correctly.

Example: http://dojo-sandbox.net/public/7e572/1

This is consistent with 1.10.3

Attachments (1)

comboWidth.html (1.6 KB) - added by bill 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by bill

Attachment: comboWidth.html added

comment:1 Changed 4 years ago by Rubbinio

Same issue occurs when using more choices pagination. As soon as a page is smaller, or equal to the widget width it stops auto resizing the pages. The auto resize works fine up until the moment we have a page with a smaller or equal width with the widget.

The problem comes from this code which sets a hardcoded style width on the dropdown node and it forces to a fixed width.

if(this.forceWidth || (this.autoWidth && aroundNode.offsetWidth > dropDown._popupWrapper.offsetWidth)){
				var widthAdjust = aroundNode.offsetWidth - dropDown._popupWrapper.offsetWidth;
				var resizeArgs = {
					w: dropDown.domNode.offsetWidth + widthAdjust
				};
				if(lang.isFunction(dropDown.resize)){
					dropDown.resize(resizeArgs);
				}else{
					domGeometry.setMarginBox(ddNode, resizeArgs);
				}

				// If dropdown is right-aligned then compensate for width change by changing horizontal position
				if(retVal.corner[1] == "R"){
					dropDown._popupWrapper.style.left =
						(dropDown._popupWrapper.style.left.replace("px", "") - widthAdjust) + "px";
				}
			}

comment:2 Changed 4 years ago by bill

Right, I assume we need to restore the dropdown's original width setting when it's closed. popup.js has similar code for restoring the height.

comment:3 Changed 4 years ago by gerhard presser

this also happens when searching. if a resultset gets displayed which is smaller than the input-field, the width is set and never removed.

any plans to fix this for the next 1.10 release?

comment:4 Changed 3 years ago by bill

Milestone: tbd1.9.8
Owner: set to bill
Status: newassigned

comment:5 Changed 3 years ago by bill

Yes, I'll push a fix for 1.9, 1.10, and 1.11.

comment:6 Changed 3 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In 1fa7d06b58c953a6cdd5dbeacb092835d9e6966c/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 3 years ago by Bill Keese <bill@…>

Resolution: fixed
Status: assignedclosed

In e050ba5e4f6031d49529c0bba69d34056d324a91/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:7 Changed 3 years ago by Bill Keese <bill@…>

In 7f911df997d136a63bfa2c1db4775f053c773100/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.