Skip to content

Commit d61f99a

Browse files
committed
fix
1 parent 8adfe87 commit d61f99a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/uui-table/lib/uui-table-row.element.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
66
import { css, html, LitElement } from 'lit';
77
import { queryAssignedElements } from 'lit/decorators.js';
88

9-
import { UUITableCellElement } from './uui-table-cell.element';
10-
119
/**
1210
* Table row element with option to set is as selectable. Parent for uui-table-cell. Must be a child of uui-table.
1311
* @element uui-table-row
@@ -50,13 +48,15 @@ export class UUITableRowElement extends SelectOnlyMixin(
5048
private slotCellNodes?: unknown[];
5149

5250
protected updated(changedProperties: Map<string | number | symbol, unknown>) {
53-
if (changedProperties.has('selectOnly')) this.updateChildSelectOnly();
51+
if (changedProperties.has('selectOnly')) {
52+
this.updateChildSelectOnly();
53+
}
5454
}
5555

5656
private updateChildSelectOnly() {
5757
if (this.slotCellNodes) {
58-
this.slotCellNodes.forEach(el => {
59-
if (el instanceof UUITableCellElement) {
58+
this.slotCellNodes.forEach((el: any) => {
59+
if (el.disableChildInteraction !== undefined) {
6060
el.disableChildInteraction = this.selectOnly;
6161
}
6262
});

packages/uui-table/lib/uui-table-row.story.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { html } from 'lit';
44
import type { Meta, StoryObj } from '@storybook/web-components';
55
import { ArrayOfUmbracoWords } from '../../../storyhelpers/UmbracoWordGenerator';
66

7+
import '@umbraco-ui/uui-table';
8+
import '@umbraco-ui/uui-input';
9+
import '@umbraco-ui/uui-button';
10+
711
const meta: Meta = {
812
id: 'uui-table-row',
913
component: 'uui-table-row',
@@ -12,14 +16,14 @@ const meta: Meta = {
1216
<uui-table>
1317
<uui-table-row
1418
?selectable=${args.selectable}
15-
?selectOnly=${args.selectOnly}>
19+
?select-only=${args.selectOnly}>
1620
${ArrayOfUmbracoWords(5).map(
1721
el => html`<uui-table-cell>${el}</uui-table-cell>`,
1822
)}
1923
</uui-table-row>
2024
<uui-table-row
2125
?selectable=${args.selectable}
22-
?selectOnly=${args.selectOnly}>
26+
?select-only=${args.selectOnly}>
2327
<uui-table-cell>
2428
<uui-input placeholder="Type your own thing"></uui-input>
2529
</uui-table-cell>

0 commit comments

Comments
 (0)