Skip to content

Commit

Permalink
fix(ld-button): prop forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
renet authored and borisdiakur committed Dec 1, 2021
1 parent e086a62 commit dfd53da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/liquid/components/ld-label/ld-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class LdLabel {

if (inputElement && !clickedInsideInputElement) {
if ('focusInner' in inputElement) {
await ((inputElement as unknown) as InnerFocusable).focusInner()
await (inputElement as unknown as InnerFocusable).focusInner()
} else {
inputElement.focus()
}
Expand All @@ -44,17 +44,19 @@ export class LdLabel {
}

render() {
const cl = getClassNames([
'ld-label',
this.alignMessage && 'ld-label--align-message',
this.position && `ld-label--${this.position}`,
this.size && `ld-label--${this.size}`,
])

return (
<label
class={getClassNames([
'ld-label',
this.alignMessage && 'ld-label--align-message',
this.position && `ld-label--${this.position}`,
this.size && `ld-label--${this.size}`,
])}
class={cl}
onClick={this.handleClick}
part="tag"
{...cloneAttributes(this.el)}
{...cloneAttributes(this.el, ['align-message', 'position', 'size'])}
>
<slot></slot>
</label>
Expand Down
1 change: 1 addition & 0 deletions src/liquid/components/ld-label/test/ld-label.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jest.mock('../../../utils/cloneAttributes')
import { newSpecPage } from '@stencil/core/testing'
import { LdInput } from '../../ld-input/ld-input'
import { LdCheckbox } from '../../ld-checkbox/ld-checkbox'
Expand Down

0 comments on commit dfd53da

Please sign in to comment.