Skip to content

Commit

Permalink
fix(BTable): BTable rowDblClicked event not working fixes #1795
Browse files Browse the repository at this point in the history
Co-authored-by: Ángel Roldán Martínez <Angel.RoldanMartinez@Clarivate.com>
  • Loading branch information
anrolmar and Ángel Roldán Martínez committed Mar 19, 2024
1 parent cd7aaf2 commit bf9c8c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions packages/bootstrap-vue-next/src/components/BTable/BTable.vue
Expand Up @@ -8,6 +8,11 @@
:tbody-tr-class="getRowClasses"
:field-column-class="getFieldColumnClasses"
@head-clicked="onFieldHeadClick"
@row-dbl-clicked="
(row, index, e) => {
emit('row-dbl-clicked', row, index, e)
}
"
@row-clicked="onRowClick"
@row-hovered="
(row, index, e) => {
Expand Down Expand Up @@ -83,7 +88,7 @@

<script setup lang="ts" generic="T = Record<string, unknown>">
import {useToNumber, useVModel} from '@vueuse/core'
import {computed, onMounted, ref, type Ref, type StyleValue, toRef, watch} from 'vue'
import {computed, onMounted, type Ref, ref, type StyleValue, toRef, watch} from 'vue'
import type {
BTableLiteProps,
BTableProvider,
Expand All @@ -96,12 +101,12 @@ import type {
TableFieldRaw,
TableItem,
} from '../../types'
import BSpinner from '../BSpinner.vue'
import {formatItem, get, getTableFieldHeadLabel} from '../../utils'
import BOverlay from '../BOverlay/BOverlay.vue'
import BSpinner from '../BSpinner.vue'
import BTableLite from './BTableLite.vue'
import BTd from './BTd.vue'
import BTr from './BTr.vue'
import {formatItem, get, getTableFieldHeadLabel} from '../../utils'
type NoProviderTypes = 'paging' | 'sorting' | 'filtering'
Expand Down
@@ -1,7 +1,7 @@
import {enableAutoUnmount, mount} from '@vue/test-utils'
import type {LiteralUnion, TableField, TableItem} from 'src/types'
import {afterEach, describe, expect, it} from 'vitest'
import BTable from './BTable.vue'
import type {LiteralUnion, TableField, TableItem} from 'src/types'

interface SimplePerson {
first_name: string
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('tbody', () => {
expect(heads[1].text()).toBe('Age')
})

it('shows sortable columns when sortalbe === true', () => {
it('shows sortable columns when sortable === true', () => {
const wrapper = mount(BTable, {
props: {items: simpleItems, fields: simpleFields},
})
Expand All @@ -75,7 +75,7 @@ describe('tbody', () => {
expect(heads[1].classes()).toContain('b-table-sortable-column')
})

it('does not show sortable columns when sortalbe undefined', () => {
it('does not show sortable columns when sortable undefined', () => {
const wrapper = mount(BTable, {
props: {items: simpleItems},
})
Expand Down

0 comments on commit bf9c8c4

Please sign in to comment.