Skip to content

Commit 059cd24

Browse files
authored
feat: make FlyoutButton.callbackKey public (#9381)
1 parent 3c2e7ba commit 059cd24

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

core/flyout_button.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ export class FlyoutButton
4242
/** The radius of the flyout button's borders. */
4343
static BORDER_RADIUS = 4;
4444

45+
/** The key to the function called when this button is activated. */
46+
readonly callbackKey: string;
47+
4548
private readonly text: string;
4649
private readonly position: Coordinate;
47-
private readonly callbackKey: string;
4850
private readonly cssClass: string | null;
4951

5052
/** Mouse up event data. */
@@ -90,12 +92,13 @@ export class FlyoutButton
9092

9193
this.position = new Coordinate(0, 0);
9294

93-
/** The key to the function called when this button is clicked. */
95+
/**
96+
* The key to the function called when this button is activated.
97+
* Check both the uppercase and lowercase version, because the docs
98+
* say `callbackKey` but the type says `callbackkey`.
99+
*/
94100
this.callbackKey =
95-
(json as AnyDuringMigration)[
96-
'callbackKey'
97-
] /* Check the lower case version
98-
too to satisfy IE */ ||
101+
(json as AnyDuringMigration)['callbackKey'] ||
99102
(json as AnyDuringMigration)['callbackkey'];
100103

101104
/** If specified, a CSS class to add to this button. */

0 commit comments

Comments
 (0)