diff --git a/gradle/changelog/modal-focus.yaml b/gradle/changelog/modal-focus.yaml new file mode 100644 index 0000000000..c492f522d6 --- /dev/null +++ b/gradle/changelog/modal-focus.yaml @@ -0,0 +1,2 @@ +- type: added + description: initial focus, submission on pressing enter and fix trap focus for modals ([#1925](https://github.com/scm-manager/scm-manager/pull/1925)) diff --git a/scm-ui/ui-components/.storybook/main.js b/scm-ui/ui-components/.storybook/main.js index 3e196d1444..1fc137486e 100644 --- a/scm-ui/ui-components/.storybook/main.js +++ b/scm-ui/ui-components/.storybook/main.js @@ -27,11 +27,14 @@ const fs = require("fs"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const RemoveThemesPlugin = require("./RemoveThemesPlugin"); const WorkerPlugin = require("worker-plugin"); +const ReactDOM = require("react-dom"); const root = path.resolve(".."); const themedir = path.join(root, "ui-styles", "src"); +ReactDOM.createPortal = node => node; + const themes = fs .readdirSync(themedir) .map(filename => path.parse(filename)) @@ -50,7 +53,7 @@ module.exports = { // add our themes to webpack entry points config.entry = { main: config.entry, - ...themes, + ...themes }; // create separate css files for our themes diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index c3e96f5f2a..918f8cf1cb 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -92,7 +92,8 @@ "remark-parse": "^9.0.0", "remark-rehype": "^8.0.0", "tabbable": "^5.2.1", - "unified": "^9.2.1" + "unified": "^9.2.1", + "@headlessui/react": "^1.4.3" }, "babel": { "presets": [ diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index f5f2111693..876ccde558 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -19192,7 +19192,161 @@ exports[`Storyshots MarkdownView Xml Code Block 1`] = ` `; -exports[`Storyshots Modal/ConfirmAlert Default 1`] = `null`; +exports[`Storyshots Modal/ConfirmAlert Autofocus 1`] = ` +