Allow the slider's thumb to receive focus when tapping or dragging (#1337)

* fix paths and imports; closes #1303

* allow slider thumb to receive focus on tap; fixes #1312
This commit is contained in:
Cory LaViska
2025-08-19 17:10:15 -04:00
committed by GitHub
parent 08babbce6d
commit 406f3a0e81
4 changed files with 10 additions and 3 deletions

View File

@@ -182,6 +182,10 @@ export default {
jsxTypesPlugin({
fileName: 'custom-elements-jsx.d.ts',
outdir,
defaultExport: true,
componentTypePath: (_name, _tag, modulePath) => {
return `./${modulePath}`;
},
}),
//

View File

@@ -22,6 +22,8 @@ Components with the <wa-badge variant="warning">Experimental</wa-badge> badge sh
- Fixed a bug in `<wa-dropdown>` that prevented keyboard selection of items when nested in shadow roots [issue:1270]
- Fixed a bug in `<wa-dropdown>` that prevented items passed in from slots from being detected [issue:1271]
- Fixed a bug in JSX typings that prevented the types file from being exported [pr:1295]
- Fixed a bug in JSX typings that generated the incorrect component imports [issue:1303]
- Fixed a bug in `<wa-slider>` that prevented the thumb from receiving focus when clicking/tapping [issue:1312]
## 3.0.0-beta.4

View File

@@ -33,6 +33,8 @@
}
#slider {
touch-action: none;
&:focus {
outline: none;
}

View File

@@ -55,6 +55,8 @@ const supportsTouch = typeof window !== 'undefined' && 'ontouchstart' in window;
* Drag functionality will be enabled as soon as the constructor is called. A `start()` and `stop()` method can be used
* to start and stop it, if needed.
*
* Use `touch-action: none` on touch devices if scrolling occurs while dragging. Avoid preventing the touchstart event!
*
* @usage
*
* const draggable = new DraggableElement(element, {
@@ -85,9 +87,6 @@ export class DraggableElement {
const clientX = supportsTouch && 'touches' in event ? event.touches[0].clientX : (event as PointerEvent).clientX;
const clientY = supportsTouch && 'touches' in event ? event.touches[0].clientY : (event as PointerEvent).clientY;
// Prevent scrolling while dragging
event.preventDefault();
if (
this.isDragging ||
// Prevent right-clicks from triggering drags