Skip to content

Commit

Permalink
fix(addon-commerce): InputCardGrouped fix problem with in safari (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored May 4, 2022
1 parent 0200895 commit 9948640
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 68 deletions.
68 changes: 66 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,9 @@

.t-common-wrapper {
position: relative;
z-index: 2; // note: fix problem in safari, where were incorrect paint child layers by css translate3d
height: 100%;
width: 100%;
overflow: hidden;

.t-wrapper,
.t-icons {
z-index: 1;
}
}

.t-wrapper {
Expand Down Expand Up @@ -81,31 +75,17 @@
line-height: 2.25rem;
pointer-events: none;

&:before {
&_enable-mask:before {
content: attr(data-before);
}

:-webkit-autofill ~ & {
background: var(--tui-autofill);
}

:-webkit-autofill ~ &_inactive,
&_inactive,
:host._disabled &_inactive {
color: transparent;
background: transparent;
transition: color 0s var(--tui-duration), background 0s var(--tui-duration);

&:before {
color: transparent;
transition: color 0s var(--tui-duration);
}
&_enable-mask .t-collapsed-wrapper {
left: 1.375rem;
}
}

.t-collapsed-wrapper {
position: absolute;
left: 1.375rem;
top: 0;
display: block;
width: 100%;
Expand All @@ -119,7 +99,6 @@
bottom: 0;
right: 100%;
display: block;
text-indent: -0.375rem;
transform: translate3d(100%, 0, 0);

&_collapsed {
Expand All @@ -133,47 +112,34 @@
border: 0;
padding: 0 1rem;

&:not(.t-input_prefilled)::placeholder {
&::placeholder {
color: var(--tui-text-03);
opacity: 0;
}

:host[data-mode='onDark'] &::placeholder {
color: var(--tui-text-03-night);
}

:host._focused &:not(:read-only)::placeholder {
opacity: 1;
}

&_card {
transition: color 0s var(--tui-duration);

&::-webkit-textfield-decoration-container {
display: none;
&:not(.t-input_hidden),
&:not(.t-input_hidden)::placeholder,
&:not(.t-input_hidden):-webkit-autofill {
caret-color: var(--tui-base-09);
color: transparent !important;
-webkit-text-fill-color: transparent !important;
}

:host._disabled & {
transition: color 0s;
//noinspection CssInvalidPseudoSelector
&::-webkit-credit-card-auto-fill-button {
pointer-events: none;
background-color: transparent !important;
-webkit-mask-image: none !important;
}
}

&_inert {
pointer-events: none;
}

&_hidden,
:host._disabled &_hidden {
color: transparent;
transition: color 0s;

&:-webkit-autofill,
&:-webkit-autofill:hover,
&:-webkit-autofill:focus {
color: transparent !important;
-webkit-text-fill-color: transparent !important;
}
}
}

.t-icons {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
tuiInputMode="numeric"
class="t-input t-input_card"
[class.t-input_inert]="cardPrefilled"
[class.t-input_hidden]="isCardCollapsed"
[class.t-input_hidden]="!card.length && focused"
[attr.id]="idCard"
[attr.aria-invalid]="!cardPrefilled && !(this.card | tuiMapper: cardValidator)"
[placeholder]="cardPrefilled ? '' : exampleText"
Expand All @@ -42,8 +42,8 @@
<span
aria-hidden="true"
class="t-collapsed"
[class.t-collapsed_inactive]="!isCardCollapsed"
[attr.data-before]="masked"
[class.t-collapsed_enable-mask]="isCardCollapsed"
>
<span class="t-collapsed-wrapper">
<span
Expand Down
3 changes: 3 additions & 0 deletions projects/core/styles/mixins/textfield.less
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
user-select: none;
color: var(--tui-text-02);
pointer-events: none;
will-change: transform;
transform: translateY(0);

&_raised {
transform: translateY(-0.625rem);
Expand Down Expand Up @@ -204,6 +206,7 @@

@supports (-webkit-hyphens: none) {
& {
will-change: unset;
transition-property: transform, color, letter-spacing;
}
}
Expand Down
2 changes: 2 additions & 0 deletions projects/demo-integrations/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ declare global {
tuiWaitKitDialog: typeof tuiWaitKitDialog;
tuiSetNightMode: typeof tuiSetNightMode;
tuiHideNavigation: typeof tuiHideNavigation;

tab(options?: Partial<{shift: Boolean}>): Chainable;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions projects/demo-integrations/cypress/support/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import './commands';
import 'cypress-plugin-tab';
Loading

0 comments on commit 9948640

Please sign in to comment.