Skip to content

Commit

Permalink
implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Nov 13, 2024
1 parent d9bc32e commit 16949bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pat/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Base from "@patternslib/patternslib/src/core/base";
import _ from "underscore";
import Backdrop from "../backdrop/backdrop";
import registry from "@patternslib/patternslib/src/core/registry";
import dom from "@patternslib/patternslib/src/core/dom";
import utils from "../../core/utils";
import _t from "../../core/i18n-wrapper";

Expand Down Expand Up @@ -771,8 +772,7 @@ export default Base.extend({
var inputs = [];

for (const el of [...inputsBody, ...inputsFooter]) {
const style = window.getComputedStyle(el);
if (style.display !== 'none' && style.visibility !== 'hidden' && style.opacity !== '0') {
if (dom.is_visible(el)) {
inputs.push(el);
}
}
Expand Down Expand Up @@ -815,7 +815,7 @@ export default Base.extend({
});
}

if (firstInput && ["INPUT", "SELECT"].includes(firstInput.nodeName)) {
if (firstInput && ["INPUT", "SELECT", "TEXTAREA"].includes(firstInput.nodeName)) {
// autofocus first element when opening a modal with a form
firstInput.focus();
}
Expand Down

0 comments on commit 16949bc

Please sign in to comment.