Skip to content

Commit

Permalink
🐛 fix(bal-date): Tabnavigation get stuck in the date input (#1171)
Browse files Browse the repository at this point in the history
* Create PR for #1167

* fix(input-date): tab navigation

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gery Hirschfeld <[email protected]>
  • Loading branch information
github-actions[bot] and hirsch88 authored Dec 4, 2023
1 parent cc142d9 commit 185f6ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cuddly-deers-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/design-system-components': patch
---

Fix tab navigation functionality for the `bal-input-date` component when a value is set.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export class MaskKeyboardContext extends MaskContext<MaskKeyboardContextEvent> {
return this._options.event.key === 'Backspace'
}

get isTabKey() {
return this._options.event.key === 'Tab'
}

get isWhiteSpaceKey() {
return this._options.event.key === ' '
}
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/utils/mask/mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ export abstract class AbstractMask implements Mask {
//
// hit a range of chars
} else {
context.preventDefault()
if (!context.isTabKey) {
context.preventDefault()
}

if (context.isBackspaceKey || context.isDeleteKey) {
this.resetInputValueWithMask(context)
Expand Down

0 comments on commit 185f6ca

Please sign in to comment.