diff --git a/ui/npm-shrinkwrap.json b/ui/npm-shrinkwrap.json index 92e31a7..001938a 100644 --- a/ui/npm-shrinkwrap.json +++ b/ui/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "web-ui-boilerplate", - "version": "3.1.9", + "version": "3.1.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "web-ui-boilerplate", - "version": "3.1.9", + "version": "3.1.10", "license": "ISC", "dependencies": { "dialog-polyfill": "^0.5.6" diff --git a/ui/src/javascript/web-components/webui-make-clickable.ts b/ui/src/javascript/web-components/webui-make-clickable.ts index 39081e6..9747555 100644 --- a/ui/src/javascript/web-components/webui-make-clickable.ts +++ b/ui/src/javascript/web-components/webui-make-clickable.ts @@ -14,6 +14,12 @@ export default class WebUIMakeClickable extends HTMLElement { return; } + // Allow nested buttons to do their thing. + const target = e.target as HTMLElement; + if (target?.nodeName === 'BUTTON') { + return; + } + if (e.target !== this.link) { this.link?.click(); } diff --git a/ui/src/stylesheets/web-components/_webui-share.scss b/ui/src/stylesheets/web-components/_webui-share.scss index 753d389..fb66a20 100644 --- a/ui/src/stylesheets/web-components/_webui-share.scss +++ b/ui/src/stylesheets/web-components/_webui-share.scss @@ -7,6 +7,8 @@ Dependencies. // @use '../mixins' as *; webui-share { + display: inline-block; + &:not(:defined) { display: none; } diff --git a/ui/stories/6. Web Components Or Custom Elements/WebUI Make Clickable/WebUIMakeClickable.js b/ui/stories/6. Web Components Or Custom Elements/WebUI Make Clickable/WebUIMakeClickable.js index 6ae6c16..daaf44b 100644 --- a/ui/stories/6. Web Components Or Custom Elements/WebUI Make Clickable/WebUIMakeClickable.js +++ b/ui/stories/6. Web Components Or Custom Elements/WebUI Make Clickable/WebUIMakeClickable.js @@ -26,9 +26,40 @@ export const WebUIMakeClickableHtml = () => ` Title is the primary link -

This whole component is clickable.

-

This is a secondary link.

-

Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugiat, totam molestiae. Soluta voluptatem deleniti excepturi laudantium. Officia at repudiandae quo nulla reiciendis optio modi nemo.

+

This whole component is clickable, and goes to the primary link URL.

+

This is a secondary link that goes to a different URL.

+

This is a <webui-share> web component to test (nested) button events.

+ + + + + +
+ + + +
+
+