mirror of
https://github.com/igorski/bitmappery.git
synced 2026-06-16 19:25:38 +02:00
Improve keyboard accessibility of slider component
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user