Skip to content

Commit

Permalink
Refactor #3889 - For SpeedDial
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Apr 27, 2023
1 parent 5acf877 commit 59c25cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
8 changes: 4 additions & 4 deletions components/lib/speeddial/SpeedDial.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ export interface SpeedDialPassThroughOptions {
*/
icon?: SpeedDialPassThroughOptionType;
/**
* Uses to pass attributes to the list's DOM element.
* Uses to pass attributes to the menu's DOM element.
*/
list?: SpeedDialPassThroughOptionType;
menu?: SpeedDialPassThroughOptionType;
/**
* Uses to pass attributes to the item's DOM element.
* Uses to pass attributes to the menu item's DOM element.
*/
item?: SpeedDialPassThroughOptionType;
menuitem?: SpeedDialPassThroughOptionType;
/**
* Uses to pass attributes to the action's DOM element.
*/
Expand Down
15 changes: 12 additions & 3 deletions components/lib/speeddial/SpeedDial.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
</template>
</SDButton>
</slot>
<ul :ref="listRef" :id="id + '_list'" class="p-speeddial-list" role="menu" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :aria-activedescendant="focused ? focusedOptionId : undefined" tabindex="-1" v-bind="ptm('list')">
<ul :ref="listRef" :id="id + '_list'" class="p-speeddial-list" role="menu" @focus="onFocus" @blur="onBlur" @keydown="onKeyDown" :aria-activedescendant="focused ? focusedOptionId : undefined" tabindex="-1" v-bind="ptm('menu')">
<template v-for="(item, index) of model" :key="index">
<li v-if="isItemVisible(item)" :id="`${id}_${index}`" :aria-controls="`${id}_item`" class="p-speeddial-item" :class="itemClass(`${id}_${index}`)" :style="getItemStyle(index)" role="menuitem" v-bind="ptm('item')">
<li
v-if="isItemVisible(item)"
:id="`${id}_${index}`"
:aria-controls="`${id}_item`"
class="p-speeddial-item"
:class="itemClass(`${id}_${index}`)"
:style="getItemStyle(index)"
role="menuitem"
v-bind="ptm('menuitem', { activeDescendant: focused ? focusedOptionId : undefined })"
>
<template v-if="!$slots.item">
<a
v-tooltip:[tooltipOptions]="{ value: item.label, disabled: !tooltipOptions }"
Expand All @@ -36,7 +45,7 @@
:target="item.target"
@click="onItemClick($event, item)"
:aria-label="item.label"
v-bind="ptm('action')"
v-bind="ptm('action', { activeDescendant: focused ? focusedOptionId : undefined })"
>
<span v-if="item.icon" :class="['p-speeddial-action-icon', item.icon]" v-bind="ptm('actionIcon')"></span>
</a>
Expand Down

0 comments on commit 59c25cb

Please sign in to comment.