kopia lustrzana https://github.com/shoelace-style/shoelace
fix checkbox required label in Chrome
See https://bugs.chromium.org/p/chromium/issues/detail?id=1413733pull/1186/head
rodzic
776ab2c715
commit
f03de8925b
|
@ -16,6 +16,7 @@ New versions of Shoelace are released as-needed and generally occur when a criti
|
||||||
- Fixed a bug in `<sl-checkbox>` and `<sl-switch>` that caused the browser to scroll incorrectly when focusing on a control in a container with overflow [#1169](https://github.com/shoelace-style/shoelace/issues/1169)
|
- Fixed a bug in `<sl-checkbox>` and `<sl-switch>` that caused the browser to scroll incorrectly when focusing on a control in a container with overflow [#1169](https://github.com/shoelace-style/shoelace/issues/1169)
|
||||||
- Fixed a bug in `<sl-menu-item>` that caused the `click` event to be emitted when the item was disabled [#1113](https://github.com/shoelace-style/shoelace/issues/1113)
|
- Fixed a bug in `<sl-menu-item>` that caused the `click` event to be emitted when the item was disabled [#1113](https://github.com/shoelace-style/shoelace/issues/1113)
|
||||||
- Fixed a bug in form controls that erroneously prevented validation states from being set when `novalidate` was used on the containing form [#1164](https://github.com/shoelace-style/shoelace/issues/1164)
|
- Fixed a bug in form controls that erroneously prevented validation states from being set when `novalidate` was used on the containing form [#1164](https://github.com/shoelace-style/shoelace/issues/1164)
|
||||||
|
- Fixed a bug in `<sl-checkbox>` that caused the required asterisk to appear before the label in Chrome
|
||||||
- Improved the behavior of `<sl-dropdown>` in Safari so keyboard interaction works the same as in other browsers [#1177](https://github.com/shoelace-style/shoelace/issues/1177)
|
- Improved the behavior of `<sl-dropdown>` in Safari so keyboard interaction works the same as in other browsers [#1177](https://github.com/shoelace-style/shoelace/issues/1177)
|
||||||
- Improved the [icons](/components/icon) page so it's not as sluggish in Safari [#1122](https://github.com/shoelace-style/shoelace/issues/1122)
|
- Improved the [icons](/components/icon) page so it's not as sluggish in Safari [#1122](https://github.com/shoelace-style/shoelace/issues/1122)
|
||||||
- Improved the accessibility of `<sl-switch>` when used in forced-colors / Windows High Contrast mode [#1114](https://github.com/shoelace-style/shoelace/issues/1114)
|
- Improved the accessibility of `<sl-switch>` when used in forced-colors / Windows High Contrast mode [#1114](https://github.com/shoelace-style/shoelace/issues/1114)
|
||||||
|
|
|
@ -157,6 +157,11 @@ export default class SlCheckbox extends ShoelaceElement implements ShoelaceFormC
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
//
|
||||||
|
// NOTE: we use a <div> around the label slot because of this Chrome bug.
|
||||||
|
//
|
||||||
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1413733
|
||||||
|
//
|
||||||
return html`
|
return html`
|
||||||
<label
|
<label
|
||||||
part="base"
|
part="base"
|
||||||
|
@ -209,7 +214,9 @@ export default class SlCheckbox extends ShoelaceElement implements ShoelaceFormC
|
||||||
: ''}
|
: ''}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<slot part="label" class="checkbox__label"></slot>
|
<div part="label" class="checkbox__label">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
</label>
|
</label>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue