Skip to content
Snippets Groups Projects

Issue #3359012: Claro: Modal dialog buttons not aligned in the "Leave preview" dialog.

Closed Issue #3359012: Claro: Modal dialog buttons not aligned in the "Leave preview" dialog.
1 unresolved thread
Closed utkarsh_33 requested to merge issue/drupal-3359012:auto-adjust-dialog-width into 11.x
1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
150 const $buttonset = $dialog.parent().find('.ui-dialog-buttonset');
151 const combinedButtonWidth =
152 $buttonset
153 .find('button')
154 .toArray()
155 .reduce((prior, button) => {
156 return prior + $(button).outerWidth();
157 }, 0) +
158 Math.ceil(
159 $buttonset.outerWidth() -
160 $buttonset.closest('.ui-dialog-buttonpane').outerWidth(),
161 ) *
162 2;
163
164 if (combinedButtonWidth > $dialog.width()) {
165 $dialog.dialog('option', 'minWidth', combinedButtonWidth);
  • I'm wondering if we should be setting this value even if minWidth has been defined in response.dialogOptions? I was first thinking that changing min-width would be non-intrusive because dialog can be expected to be wider than the min-width. However, this also impacts how jQuery UI resizable behaves meaning that it could lead into unexpected behavior change.

    I'm also wondering if we should make sure that the minWidth we're setting is not larger than maxWidth when it's configured?

  • It might be easier if we split out this change from the core/modules/node/node.preview.js change. I don't have strong opinions on this though.

  • Discussed w/ Lauri and this is now addressed by making sure we only reset the minWidth if there is no maxWidth or if the combinedButtonWidth is less than the maxWidth

  • Harumi Jang changed this line in version 5 of the diff

    changed this line in version 5 of the diff

  • Please register or sign in to reply
  • Harumi Jang added 1 commit

    added 1 commit

    • 53a05a37 - Make sure that combinedButtonWidth is not more than the max width of the dialog

    Compare with previous version

  • Harumi Jang added 1 commit

    added 1 commit

    • 2c47df0a - Confirm minwidth change will not affect maxWidth

    Compare with previous version

  • Harumi Jang added 125 commits

    added 125 commits

    • 2c47df0a...f597d0ec - 122 commits from branch project:10.1.x
    • 90cb5f92 - auto adjust dialog width if buttons are wider than the provided space
    • 97e32675 - Make sure that combinedButtonWidth is not more than the max width of the dialog
    • c125edc6 - Confirm minwidth change will not affect maxWidth

    Compare with previous version

  • Harumi Jang added 1 commit

    added 1 commit

    Compare with previous version

  • Harumi Jang added 1 commit

    added 1 commit

    Compare with previous version

  • Lauri Timmanee changed the description

    changed the description

  • Lauri Timmanee changed target branch from 10.1.x to 11.x

    changed target branch from 10.1.x to 11.x

  • Lauri Timmanee added 234 commits

    added 234 commits

    Compare with previous version

  • Lauri Timmanee added 1 commit

    added 1 commit

    • ea5b157f - Use logical properties instead

    Compare with previous version

  • Lauri Timmanee added 1 commit

    added 1 commit

    • 59df5e97 - Make the selector work with link buttons

    Compare with previous version

  • Lauri Timmanee added 1 commit

    added 1 commit

    • cad33c46 - Define spacing according to Figma designs

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading