Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5531 closed bug (fixed)

dialog width should be at least minWidth on creation

Reported by: zhaoz Owned by:
Priority: major Milestone: 1.8.3
Component: ui.dialog Version: 1.8
Keywords: Cc:
Blocked by: Blocking:

Description

Right now, when .dialog() is called, the minWidth is not respected until resize.

That is, if minwidth is 500px, and the width is 300px. The dialog would be created with a width of 300px instead of 500px. However, after resizing the minWidth applies.

Expected Behaivior:

  • The dialog should never have a width of less than minWidth
  • dialog should not be created with a width less than minwidth

Observed Behaivior:

  • dialog on creation is created with a width less than minwidth, when (width < minwidth)

Change History (11)

comment:1 Changed 6 years ago by zhaoz

I have a fix here: http://github.com/zhaoz/jquery-ui/commit/19388da8d7c50203a5a15dba063d5052346d3bb4

Unsure if that is an acceptable location for commits, will attach a patch as well.

comment:2 Changed 6 years ago by zhaoz

This needs to be filed under ui.dialog... sorry. I don't think I have the ability to change it though.

comment:3 Changed 6 years ago by jzaefferer

  • Component changed from ui.core to ui.dialog
  • Priority changed from minor to major

We generally don't modify options, so that bounded value needs to be stored elsewhere. Otherwise valid.

comment:4 Changed 6 years ago by scottgonzalez

  • Milestone changed from TBD to 1.9

The width option is actually a "live" value, it gets updated during resizes in order to properly maintain state. So modifying it on create is okay. We'll also need to modify it if the minWidth is adjusted after create. Commented on commit as well.

comment:5 Changed 6 years ago by zhaoz

Fixed, rebased, and amended.

http://github.com/zhaoz/jquery-ui/commit/332e3fbe2b1bfd8f5d495d35b8388e8b90fa430f

I won't be updating the patch since github seems to be preferred.

comment:6 Changed 6 years ago by zhaoz

Just realized last fix still allows people to set width through options and bypass minWidth, will amend and resubmit.

comment:7 Changed 6 years ago by zhaoz

comment:9 Changed 6 years ago by scottgonzalez

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in c5770c0. Thanks zhaoz.

comment:10 Changed 6 years ago by scottgonzalez

  • Milestone changed from 1.9 to 1.8.3

comment:11 Changed 6 years ago by Ziling Zhao

Dialog: modified so that minWidth is respected. Fixes #5531 - dialog width should be at least minWidth on creation.

Changeset: c5770c0e84b786ebe55a60034da0ff06dc02f422

Note: See TracTickets for help on using tickets.