Skip to content

Commit

Permalink
fix(input): clearabed button focusabled on disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aesteves60 committed Mar 11, 2024
1 parent 9170668 commit 1600a5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export class OsdsInput implements OdsInputAttribute, OdsInputEvent, OdsInputMeth
isPassword && !loading && (
<button
class="osds-input__icon-button"
disabled={ this.disabled }
onClick={ (): Promise<void> => this.hide() }
onKeyUp={ (event: KeyboardEvent): Promise<void> => this.controller.handleKeySpace(event, this.hide) }>
<osds-icon
Expand All @@ -266,6 +267,7 @@ export class OsdsInput implements OdsInputAttribute, OdsInputEvent, OdsInputMeth
clearable && !loading && (
<button
class="osds-input__icon-button"
disabled={ this.disabled }
onClick={ (): Promise<void> => this.clear() }
onKeyUp={ (event: KeyboardEvent): Promise<void> => this.controller.handleKeySpace(event, this.clear) }>
<osds-icon
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/input/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<body style="margin: 0;">
<button>1</button>
<button>2</button>
<osds-input inline type="text" value="On Vous Héberge ?" clearable id="input"></osds-input>
<osds-input inline type="text" value="On Vous Héberge ?" clearable id="input" disabled></osds-input>
<button>3</button>

<script>
const input = document.getElementById('input');
input.addEventListener('focus', () => {
console.log('osds-input focus')
console.log('osds-input focus');
})
</script>
<!-- <osds-input inline type="password" value="On Vous Héberge ?" disabled clearable></osds-input>
Expand Down

0 comments on commit 1600a5e

Please sign in to comment.