Skip to content

Commit

Permalink
Fix slider focus on touch issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulioRandall committed Apr 18, 2024
1 parent 067d367 commit ef3b485
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Svelte library experimenting with form behaviour and user interaction (layout and style uses UK GDS as a guide)",
"type": "module",
"license": "MIT",
"version": "0.5.0",
"version": "0.5.1",
"engines": {
"node": ">=18"
},
Expand Down
5 changes: 5 additions & 0 deletions src/lib/private/SliderInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
$values[field.name] = element.value
})
const focusOnInput = () => {
element.focus()
}
if (field.format === undefined) {
field.format = metatype.defaultFormat
}
Expand All @@ -54,6 +58,7 @@
aria-errormessage={field.errorElementId}
aria-invalid={!!$errors[field.name]}
bind:value={$values[field.name]}
on:touchstart={focusOnInput}
on:blur
on:focus
on:focusin
Expand Down

0 comments on commit ef3b485

Please sign in to comment.