Skip to content

Commit e4ed53e

Browse files
committed
allow no onSelect, update integration and snap
1 parent 5fe6c5c commit e4ed53e

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

packages/react-core/src/next/components/Dropdown/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const DropdownBase: React.FunctionComponent<DropdownProps> = ({
103103
<Menu
104104
className={css(className)}
105105
ref={menuRef}
106-
onSelect={(event, itemId) => onSelect(event, itemId)}
106+
onSelect={(event, itemId) => onSelect && onSelect(event, itemId)}
107107
isPlain={isPlain}
108108
isScrollable={isScrollable}
109109
{...(minWidth && {

packages/react-core/src/next/components/Select/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const SelectBase: React.FunctionComponent<SelectProps & OUIAProps> = ({
9797
role={role}
9898
className={css(className)}
9999
ref={menuRef}
100-
onSelect={(event, itemId) => onSelect(event, itemId)}
100+
onSelect={(event, itemId) => onSelect && onSelect(event, itemId)}
101101
isPlain={isPlain}
102102
selected={selected}
103103
{...(minWidth && {

packages/react-integration/cypress/integration/tablesimpleactions.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ describe('Table Simple Actions Test', () => {
2020
});
2121

2222
it('Verify dropdown toggle', () => {
23-
cy.get('td .pf-c-dropdown__toggle')
23+
cy.get('td .pf-c-menu-toggle')
2424
.first()
2525
.should('exist');
26-
cy.get('td .pf-c-dropdown__toggle')
26+
cy.get('td .pf-c-menu-toggle')
2727
.first()
2828
.click();
29-
cy.get('.pf-c-dropdown__menu').should('exist');
30-
cy.get('.pf-c-dropdown__menu-item')
29+
cy.get('.pf-c-menu').should('exist');
30+
cy.get('.pf-c-menu__item')
3131
.first()
3232
.click();
3333
});

packages/react-table/src/components/Table/__tests__/__snapshots__/Table.test.tsx.snap

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ exports[`Table Actions table 1`] = `
157157
>
158158
<button
159159
aria-expanded="false"
160+
aria-label="Kebab toggle"
160161
class="pf-c-menu-toggle pf-m-plain"
161162
type="button"
162163
>
@@ -234,6 +235,7 @@ exports[`Table Actions table 1`] = `
234235
>
235236
<button
236237
aria-expanded="false"
238+
aria-label="Kebab toggle"
237239
class="pf-c-menu-toggle pf-m-plain"
238240
type="button"
239241
>
@@ -311,6 +313,7 @@ exports[`Table Actions table 1`] = `
311313
>
312314
<button
313315
aria-expanded="false"
316+
aria-label="Kebab toggle"
314317
class="pf-c-menu-toggle pf-m-plain"
315318
type="button"
316319
>
@@ -388,6 +391,7 @@ exports[`Table Actions table 1`] = `
388391
>
389392
<button
390393
aria-expanded="false"
394+
aria-label="Kebab toggle"
391395
class="pf-c-menu-toggle pf-m-plain"
392396
type="button"
393397
>
@@ -465,6 +469,7 @@ exports[`Table Actions table 1`] = `
465469
>
466470
<button
467471
aria-expanded="false"
472+
aria-label="Kebab toggle"
468473
class="pf-c-menu-toggle pf-m-plain"
469474
type="button"
470475
>
@@ -542,6 +547,7 @@ exports[`Table Actions table 1`] = `
542547
>
543548
<button
544549
aria-expanded="false"
550+
aria-label="Kebab toggle"
545551
class="pf-c-menu-toggle pf-m-plain"
546552
type="button"
547553
>
@@ -619,6 +625,7 @@ exports[`Table Actions table 1`] = `
619625
>
620626
<button
621627
aria-expanded="false"
628+
aria-label="Kebab toggle"
622629
class="pf-c-menu-toggle pf-m-plain"
623630
type="button"
624631
>
@@ -696,6 +703,7 @@ exports[`Table Actions table 1`] = `
696703
>
697704
<button
698705
aria-expanded="false"
706+
aria-label="Kebab toggle"
699707
class="pf-c-menu-toggle pf-m-plain"
700708
type="button"
701709
>
@@ -773,6 +781,7 @@ exports[`Table Actions table 1`] = `
773781
>
774782
<button
775783
aria-expanded="false"
784+
aria-label="Kebab toggle"
776785
class="pf-c-menu-toggle pf-m-plain"
777786
type="button"
778787
>
@@ -5383,6 +5392,7 @@ exports[`Table Simple Actions table 1`] = `
53835392
>
53845393
<button
53855394
aria-expanded="false"
5395+
aria-label="Kebab toggle"
53865396
class="pf-c-menu-toggle pf-m-plain"
53875397
type="button"
53885398
>
@@ -5460,6 +5470,7 @@ exports[`Table Simple Actions table 1`] = `
54605470
>
54615471
<button
54625472
aria-expanded="false"
5473+
aria-label="Kebab toggle"
54635474
class="pf-c-menu-toggle pf-m-plain"
54645475
type="button"
54655476
>
@@ -5537,6 +5548,7 @@ exports[`Table Simple Actions table 1`] = `
55375548
>
55385549
<button
55395550
aria-expanded="false"
5551+
aria-label="Kebab toggle"
55405552
class="pf-c-menu-toggle pf-m-plain"
55415553
type="button"
55425554
>
@@ -5614,6 +5626,7 @@ exports[`Table Simple Actions table 1`] = `
56145626
>
56155627
<button
56165628
aria-expanded="false"
5629+
aria-label="Kebab toggle"
56175630
class="pf-c-menu-toggle pf-m-plain"
56185631
type="button"
56195632
>
@@ -5691,6 +5704,7 @@ exports[`Table Simple Actions table 1`] = `
56915704
>
56925705
<button
56935706
aria-expanded="false"
5707+
aria-label="Kebab toggle"
56945708
class="pf-c-menu-toggle pf-m-plain"
56955709
type="button"
56965710
>
@@ -5768,6 +5782,7 @@ exports[`Table Simple Actions table 1`] = `
57685782
>
57695783
<button
57705784
aria-expanded="false"
5785+
aria-label="Kebab toggle"
57715786
class="pf-c-menu-toggle pf-m-plain"
57725787
type="button"
57735788
>
@@ -5845,6 +5860,7 @@ exports[`Table Simple Actions table 1`] = `
58455860
>
58465861
<button
58475862
aria-expanded="false"
5863+
aria-label="Kebab toggle"
58485864
class="pf-c-menu-toggle pf-m-plain"
58495865
type="button"
58505866
>
@@ -5922,6 +5938,7 @@ exports[`Table Simple Actions table 1`] = `
59225938
>
59235939
<button
59245940
aria-expanded="false"
5941+
aria-label="Kebab toggle"
59255942
class="pf-c-menu-toggle pf-m-plain"
59265943
type="button"
59275944
>
@@ -5999,6 +6016,7 @@ exports[`Table Simple Actions table 1`] = `
59996016
>
60006017
<button
60016018
aria-expanded="false"
6019+
aria-label="Kebab toggle"
60026020
class="pf-c-menu-toggle pf-m-plain"
60036021
type="button"
60046022
>
@@ -6076,6 +6094,7 @@ exports[`Table Simple Actions table 1`] = `
60766094
>
60776095
<button
60786096
aria-expanded="false"
6097+
aria-label="Kebab toggle"
60796098
class="pf-c-menu-toggle pf-m-plain pf-m-disabled"
60806099
disabled=""
60816100
type="button"

0 commit comments

Comments
 (0)