ScrollPanel 'aria-controls' attr added

pull/4878/head
tugcekucukoglu 2023-12-07 09:49:59 +03:00
parent 170f4c3dc5
commit d9372fdd73
1 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div :class="cx('root')" v-bind="ptm('root')" data-pc-name="scrollpanel"> <div :class="cx('root')" v-bind="ptm('root')" data-pc-name="scrollpanel">
<div :class="cx('wrapper')" v-bind="ptm('wrapper')"> <div :class="cx('wrapper')" v-bind="ptm('wrapper')">
<div ref="content" :class="cx('content')" @scroll="onScroll" @mouseenter="moveBar" v-bind="ptm('content')"> <div ref="content" :id="contentId" :class="cx('content')" @scroll="onScroll" @mouseenter="moveBar" v-bind="ptm('content')">
<slot></slot> <slot></slot>
</div> </div>
</div> </div>
@ -11,6 +11,7 @@
tabindex="0" tabindex="0"
role="scrollbar" role="scrollbar"
aria-orientation="horizontal" aria-orientation="horizontal"
:aria-controls="contentId"
:aria-valuenow="lastScrollLeft" :aria-valuenow="lastScrollLeft"
@mousedown="onXBarMouseDown" @mousedown="onXBarMouseDown"
@keydown="onKeyDown($event)" @keydown="onKeyDown($event)"
@ -26,6 +27,7 @@
tabindex="0" tabindex="0"
role="scrollbar" role="scrollbar"
aria-orientation="vertical" aria-orientation="vertical"
:aria-controls="contentId"
:aria-valuenow="lastScrollTop" :aria-valuenow="lastScrollTop"
@mousedown="onYBarMouseDown" @mousedown="onYBarMouseDown"
@keydown="onKeyDown($event)" @keydown="onKeyDown($event)"
@ -357,6 +359,11 @@ export default {
this.documentResizeListener = null; this.documentResizeListener = null;
} }
} }
},
computed: {
contentId() {
return UniqueComponentId() + '_content';
}
} }
}; };
</script> </script>