From 1f65c0892fad46b2855fd074e5a74dd2612f7742 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?= Date: Thu, 1 Sep 2022 15:47:49 +0300 Subject: [PATCH] Fixed #2920 - Improve ScrollPanel implementation for Accessibility --- api-generator/components/scrollpanel.js | 12 +- src/components/scrollpanel/ScrollPanel.d.ts | 5 + src/components/scrollpanel/ScrollPanel.vue | 133 ++++++++++++++++++-- src/views/scrollpanel/ScrollPanelDoc.vue | 69 +++++++++- 4 files changed, 208 insertions(+), 11 deletions(-) diff --git a/api-generator/components/scrollpanel.js b/api-generator/components/scrollpanel.js index f87bfca0d0..9ebb33e2e9 100644 --- a/api-generator/components/scrollpanel.js +++ b/api-generator/components/scrollpanel.js @@ -1,6 +1,16 @@ +const ScrollPanelProps = [ + { + name: "step", + type: "number", + default: "5", + description: "Step factor to scroll the content while pressing the arrow keys." + } +]; + module.exports = { scrollpanel: { name: "ScrollPanel", - description: "ScrollPanel is a cross browser, lightweight and themable alternative to native browser scrollbar." + description: "ScrollPanel is a cross browser, lightweight and themable alternative to native browser scrollbar.", + props: ScrollPanelProps } }; diff --git a/src/components/scrollpanel/ScrollPanel.d.ts b/src/components/scrollpanel/ScrollPanel.d.ts index 8e532ca900..bb5c307528 100644 --- a/src/components/scrollpanel/ScrollPanel.d.ts +++ b/src/components/scrollpanel/ScrollPanel.d.ts @@ -2,6 +2,11 @@ import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; export interface ScrollPanelProps { + /** + * Step factor to scroll the content while pressing the arrow keys. + * Default value is 5. + */ + step?: number | undefined; } export interface ScrollPanelSlots { diff --git a/src/components/scrollpanel/ScrollPanel.vue b/src/components/scrollpanel/ScrollPanel.vue index b59e0b14d8..acb32e4e49 100644 --- a/src/components/scrollpanel/ScrollPanel.vue +++ b/src/components/scrollpanel/ScrollPanel.vue @@ -1,20 +1,26 @@