Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions packages/core/src/components/bal-button/bal-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ComponentInterface,
Element,
State,
Listen,
Listen, Watch,
} from '@stencil/core'
import { Attributes, inheritAttributes } from '../../utils/attributes'
import { ariaBooleanToString } from '../../utils/aria'
Expand Down Expand Up @@ -118,7 +118,7 @@ export class Button implements ComponentInterface {
/**
* If `true` the button is a popup.
*/
@Prop() balPopup = undefined
@Prop() balPopup: boolean|undefined = undefined

/**
* Name of the left button icon
Expand Down Expand Up @@ -185,11 +185,6 @@ export class Button implements ComponentInterface {

componentDidLoad(): void {
rOnLoad(() => (this.isLargestContentPaintDone = true))
if (this.el.getAttribute('bal-popup') && !this.aria?.haspopup) {
this.aria = {
haspopup: 'true',
}
}
}

componentWillLoad() {
Expand Down Expand Up @@ -313,7 +308,7 @@ export class Button implements ComponentInterface {
'aria-label':
this.aria?.label || this.inheritAttributes['aria-label'] || this.aria?.title || this.inheritAttributes['title'],
'aria-controls': this.aria?.controls || this.inheritAttributes['aria-controls'],
'aria-haspopup': this.aria?.haspopup || this.inheritAttributes['aria-haspopup'],
'aria-haspopup': ariaBooleanToString(this.balPopup) || this.inheritAttributes['aria-haspopup'],
}

return (
Expand Down
Loading