From 97e4bf8fd64105208b83e40a0f48255e6c8c25a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= <tugcekucukoglu.860@gmail.com> Date: Wed, 27 Jul 2022 12:57:23 +0300 Subject: [PATCH] readonly state and tabindex fixed --- src/components/knob/Knob.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/knob/Knob.vue b/src/components/knob/Knob.vue index 6d1374fd8..81f7878ca 100644 --- a/src/components/knob/Knob.vue +++ b/src/components/knob/Knob.vue @@ -1,6 +1,6 @@ <template> <div :class="containerClass"> - <svg viewBox="0 0 100 100" role="slider" :width="size" :height="size" :tabindex="tabindex" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" + <svg viewBox="0 0 100 100" role="slider" :width="size" :height="size" :tabindex="readonly || disabled ? -1 : tabindex" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" @click="onClick" @keydown="onKeyDown" @mousedown="onMouseDown" @mouseup="onMouseUp" @touchstart="onTouchStart" @touchend="onTouchEnd"> <path :d="rangePath" :stroke-width="strokeWidth" :stroke="rangeColor" class="p-knob-range"></path> <path :d="valuePath" :stroke-width="strokeWidth" :stroke="valueColor" class="p-knob-value"></path> @@ -166,7 +166,7 @@ export default { } }, onKeyDown(event) { - if (!this.disabled || !this.readonly) { + if (!this.disabled && !this.readonly) { switch (event.code) { case 'ArrowLeft': case 'ArrowUp': {