Skip to content

Commit

Permalink
Fixed #4783 - AccordionTab: isTabActive property is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Nov 9, 2023
1 parent 4fdbe36 commit d62493b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/accordion/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@keydown="onTabKeyDown($event, tab, i)"
v-bind="{ ...getTabProp(tab, 'headeractionprops'), ...getTabPT(tab, 'headeraction', i) }"
>
<component v-if="tab.children && tab.children.headericon" :is="tab.children.headericon" :isTabActive="isTabActive(i)" :index="i"></component>
<component v-if="tab.children && tab.children.headericon" :is="tab.children.headericon" :isTabActive="isTabActive(i)" :active="isTabActive(i)" :index="i"></component>
<component
v-else-if="isTabActive(i)"
:is="$slots.collapseicon ? $slots.collapseicon : collapseIcon ? 'span' : 'ChevronDownIcon'"
Expand Down
6 changes: 6 additions & 0 deletions components/lib/accordiontab/AccordionTab.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,14 @@ export interface AccordionTabSlots {
/**
* Whether the tab is active
* @param {number} index - Index of the tab
* @deprecated since v3.40.0. Use 'active' property instead.
*/
isTabActive: (index: number) => void;
/**
* Whether the tab is active
* @param {number} index - Index of the tab
*/
active: (index: number) => void;

This comment has been minimized.

Copy link
@service-paradis

service-paradis Nov 20, 2023

The type for active is not good here. The results of the function is sent using :active="isTabActive(i)". So, the type here should be:

active: boolean;

Right now, we have Typescript warning when using the props:
image

}): VNode[];
}

Expand Down

0 comments on commit d62493b

Please sign in to comment.