Skip to content

Commit

Permalink
fix(addon-commerce): fix safari expire autofill
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed Nov 3, 2022
1 parent 0a68461 commit 4b7e01c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@
<span
#ghost
class="t-ghost"
>
{{ formattedCard.slice(-tailLength) }}
</span>
[innerText]="formattedCard.slice(-tailLength)"
></span>

<span class="t-collapsed-wrapper">
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export function tuiCreateAutoCorrectedExpirePipe(): TuiTextMaskPipeHandler {
TUI_EXP_SAFARI.test(rawValue)
) {
const array = rawValue.split(TUI_NON_DIGIT_REGEXP);
const month = array[1];

// TODO: investigate why the month is sometimes more than 2-length in safari
const month = array[1].slice(2);
const year = array.find(({length}) => length === 4);

conformedValue = `${`0`.repeat(2 - month.length)}${month}/${
Expand Down

0 comments on commit 4b7e01c

Please sign in to comment.