Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BTable): BTable rowDblClicked event not working #1818

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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