When the browser window is narrower than the width of the modal, the modal gets cut off. Is it possible to change it so the modal would resize with the window?

Comments

sacarney created an issue. See original summary.

johnwebdev’s picture

Category: Bug report » Feature request

Unfortunately, that does not seem to be supported by jQuery Dialog out of the box.

https://api.jqueryui.com/dialog/#option-width

Changing this to a feature request instead of bug.

strykaizer’s picture

While not documented in jquery dialog, modal_width also allows percentages.

Adding this in settings.php works:

$config['layout_builder_modal.settings']['modal_width'] = "80%";
edurenye’s picture

Status: Active » Needs review
StatusFileSize
new2.53 KB

This patch allows to enter a percentage for 'modal_width'.

Status: Needs review » Needs work

The last submitted patch, 4: layout_builder_modal-3127943-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

edurenye’s picture

Status: Needs work » Needs review
StatusFileSize
new3.49 KB
new978 bytes

Fixed tests.

murz’s picture

Thanks for the solution, it works well, and patch changes are looks good!

If "Layout Builder Modal" module is already installed, it needs reinstalling to change configuration setting from integer to string.

Maybe we can resolve this via hook_update function?

  • johnwebdev committed e32e8f3 on 8.x-1.x authored by edurenye
    Issue #3127943 by edurenye: Modal not resizing for narrow screens
    
johnwebdev’s picture

Status: Needs review » Fixed

I don't think we need a update hook here. Just tested manually, and it works great

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

berliner’s picture

An update hook would have been appreciated, but re-install also works.

Note that without an update hook, the UI works almost as expected, but whatever is entered for the width is stored as an integer, so percentage signs are removed.