Skip to content

Commit d2fb23e

Browse files
authored
Merge pull request #2251 from Akshat55/button-id
fix: prevent host & button from having same id
2 parents b04dc25 + 7dae9a0 commit d2fb23e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/button/icon-button.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { ButtonSize, ButtonType } from "./button.types";
2929
(click)="emitClickEvent($event, 'tooltip')">
3030
<button
3131
#button
32-
[id]="id"
32+
[id]="buttonId"
3333
[disabled]="disabled"
3434
[attr.type]="type"
3535
[iconOnly]="true"
@@ -88,7 +88,7 @@ export class IconButton extends BaseIconButton implements AfterViewInit {
8888
/**
8989
* Override id
9090
*/
91-
@Input() id = `icon-btn-${IconButton.iconButtonCounter++}`;
91+
@Input() buttonId = `icon-btn-${IconButton.iconButtonCounter++}`;
9292
/**
9393
* Sets the button type.
9494
*/

src/button/icon-button.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const Template: Story<IconButton> = (args) => ({
6464
props: args,
6565
template: `
6666
<ibm-icon-button
67-
id="icon-btn1"
67+
buttonId="icon-btn1"
6868
type="button"
6969
[kind]="kind"
7070
[size]="size"

0 commit comments

Comments
 (0)