Skip to content

Commit

Permalink
fix(addon-commerce): fix safari expire autofill (#3015)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Nov 7, 2022
1 parent b432f04 commit c2aac4b
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 c2aac4b

Please sign in to comment.