Improve keyboard accessibility of slider component

This commit is contained in:
Igor Zinken
2026-04-22 23:02:51 +02:00
parent abc5c7f1a3
commit 601f70716d

View File

@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
* Igor Zinken 2020-2025 - https://www.igorski.nl
* Igor Zinken 2020-2026 - https://www.igorski.nl
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -31,6 +31,7 @@
:max="max"
:step="step"
:disabled="disabled"
@keyup.enter="toggleTextInput( true )"
@dblclick="toggleTextInput( true )"
@pointerdown="handleDragStart()"
@pointerup="handleDragEnd()"
@@ -98,6 +99,12 @@ export default {
methods: {
toggleTextInput( enabled: boolean ): void {
this.textInput = enabled;
if ( enabled ) {
this.$nextTick(() => {
this.$refs.textInput?.focus();
});
}
},
handleTextFocus(): void {
this.wasSuspended = KeyboardService.getSuspended();