Skip to content

Commit

Permalink
[4.0] Fix modal data attributes (#35626)
Browse files Browse the repository at this point in the history
* Update main.php

* Update Bootstrap.php
  • Loading branch information
dgrammatiko authored Sep 22, 2021
1 parent c732050 commit 95f5ac8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions layouts/libraries/html/bootstrap/modal/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@

if (isset($params['backdrop']))
{
$modalAttributes['data-backdrop'] = (is_bool($params['backdrop']) ? ($params['backdrop'] ? 'true' : 'false') : $params['backdrop']);
$modalAttributes['data-bs-backdrop'] = (is_bool($params['backdrop']) ? ($params['backdrop'] ? 'true' : 'false') : $params['backdrop']);
}

if (isset($params['keyboard']))
{
$modalAttributes['data-keyboard'] = (is_bool($params['keyboard']) ? ($params['keyboard'] ? 'true' : 'false') : 'true');
$modalAttributes['data-bs-keyboard'] = (is_bool($params['keyboard']) ? ($params['keyboard'] ? 'true' : 'false') : 'true');
}

if (isset($params['url']))
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/HTML/Helpers/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public static function modal($selector = '', $options = []) :void
if ($selector !== '')
{
// Setup options object
$opt['backdrop'] = isset($options['backdrop']) ? (bool) $options['backdrop'] : true;
$opt['backdrop'] = isset($options['backdrop']) ? $options['backdrop'] : false;
$opt['keyboard'] = isset($options['keyboard']) ? (bool) $options['keyboard'] : true;
$opt['focus'] = isset($options['focus']) ? (bool) $options['focus'] : true;

Expand Down

0 comments on commit 95f5ac8

Please sign in to comment.