Skip to content

Commit

Permalink
fix(button): add more defense to setIconPositionProps against type er…
Browse files Browse the repository at this point in the history
…rors (#602)
  • Loading branch information
nowseemee authored Sep 30, 2021
1 parent ab721f5 commit 5263ccd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/components/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export class Button {
});
if (
!this.iconOnly &&
nodes &&
nodes.length &&
nodes[nodes.length - 1] &&
nodes[nodes.length - 1].nodeName.substr(0, 10) === 'SCALE-ICON'
) {
this.iconPosition = 'after';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export class ToggleButton {
});
if (
!this.iconOnly &&
nodes &&
nodes.length &&
nodes[nodes.length - 1] &&
nodes[nodes.length - 1].nodeName.substr(0, 10) === 'SCALE-ICON'
) {
this.iconPosition = 'after';
Expand Down

0 comments on commit 5263ccd

Please sign in to comment.