Skip to content

Commit

Permalink
fix(ktableview): replace useuniqueid with useid [KHCP-14269]
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM committed Dec 5, 2024
1 parent a04d660 commit d7c837e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/KTableView/KTableView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
</template>

<script setup lang="ts">
import { ref, watch, computed, useAttrs, useSlots, nextTick } from 'vue'
import { ref, watch, computed, useAttrs, useSlots, nextTick, useId } from 'vue'
import KButton from '@/components/KButton/KButton.vue'
import KEmptyState from '@/components/KEmptyState/KEmptyState.vue'
import KSkeleton from '@/components/KSkeleton/KSkeleton.vue'
Expand All @@ -392,7 +392,6 @@ import type {
import { EmptyStateIconVariants, TableViewHeaderKeys } from '@/types'
import { KUI_COLOR_TEXT_NEUTRAL, KUI_ICON_SIZE_30, KUI_SPACE_60 } from '@kong/design-tokens'
import ColumnVisibilityMenu from './ColumnVisibilityMenu.vue'
import useUniqueId from '@/composables/useUniqueId'
import useUtilities from '@/composables/useUtilities'
import KPagination from '@/components/KPagination/KPagination.vue'
import KDropdown from '@/components/KDropdown/KDropdown.vue'
Expand Down Expand Up @@ -453,7 +452,7 @@ const emit = defineEmits<{
const attrs = useAttrs()
const slots = useSlots()
const tableId = useUniqueId()
const tableId = useId()
const { getSizeFromString } = useUtilities()
const getRowKey = (row: Record<string, any>): string => {
Expand Down Expand Up @@ -1114,7 +1113,7 @@ watch([() => props.data, dataSelectState], (newVals) => {
// update the rowKeyMap
newData.forEach((row) => {
if (!rowKeyMap.value.get(row)) {
const uniqueRowKey = getRowKey(row) || useUniqueId()
const uniqueRowKey = getRowKey(row) || useId()
rowKeyMap.value.set(row, `table-${tableId}-row-${uniqueRowKey}`)
}
Expand Down

0 comments on commit d7c837e

Please sign in to comment.