Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the counter text color to match main. It was undone when next was updated from main.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
120 changes: 120 additions & 0 deletions core/src/components/textarea/test/highlight/textarea.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,123 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
});
});
});

configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('textarea: highlights'), () => {
test.describe('textarea: no fill', () => {
test('should render valid state correctly', async ({ page }) => {
await page.setContent(
`
<ion-textarea
value="[email protected]"
class="ion-valid has-focus"
label="Email"
label-placement="stacked"
error-text="Please enter a valid email"
helper-text="Enter an email"
counter="true"
maxlength="20"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-valid`));
});
test('should render invalid state correctly', async ({ page }) => {
await page.setContent(
`
<ion-textarea
value="[email protected]"
class="ion-touched ion-invalid"
label="Email"
label-placement="stacked"
error-text="Please enter a valid email"
helper-text="Enter an email"
counter="true"
maxlength="20"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-no-fill-invalid`));
});
});
test.describe('textarea: outline', () => {
test('should render valid state correctly', async ({ page }) => {
await page.setContent(
`
<ion-textarea
fill="outline"
value="[email protected]"
class="ion-valid has-focus"
label="Email"
label-placement="stacked"
error-text="Please enter a valid email"
helper-text="Enter an email"
counter="true"
maxlength="20"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-valid`));
});
test('should render invalid state correctly', async ({ page }) => {
await page.setContent(
`
<ion-textarea
fill="outline"
value="[email protected]"
class="ion-touched ion-invalid"
label="Email"
label-placement="stacked"
error-text="Please enter a valid email"
helper-text="Enter an email"
counter="true"
maxlength="20"
></ion-textarea>
`,
config
);

const textarea = page.locator('ion-textarea');
await expect(textarea).toHaveScreenshot(screenshot(`textarea-outline-invalid`));
});
test('should render custom highlight correctly', async ({ page }) => {
await page.setContent(
`
<style>
ion-textarea.custom {
--highlight-color-valid: purple;
}
</style>

<div class="container">
<ion-textarea
fill="outline"
value="[email protected]"
class="custom has-focus ion-valid"
label="Email"
label-placement="stacked"
error-text="Please enter a valid email"
helper-text="Enter an email"
counter="true"
maxlength="20"
></ion-textarea>
</div>
`,
config
);

const container = page.locator('.container');
await expect(container).toHaveScreenshot(screenshot(`textarea-outline-custom-highlight`));
});
});
});
});
4 changes: 0 additions & 4 deletions core/src/components/textarea/textarea.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@

border-top: var(--border-width) var(--border-style) var(--border-color);

font-size: dynamic-font(12px);

white-space: normal;
}

Expand Down Expand Up @@ -381,8 +379,6 @@

.textarea-bottom .helper-text {
display: block;

color: $text-color-step-300;
}

:host(.ion-touched.ion-invalid) .textarea-bottom .error-text {
Expand Down
19 changes: 19 additions & 0 deletions core/src/components/textarea/textarea.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ ion-icon {
color: globals.$ion-primitives-neutral-800;
}

:host(.has-focus.ion-valid) .helper-text {
color: var(--highlight-color-valid);
}

:host(.has-focus.ion-valid),
:host(.ion-touched.ion-invalid) {
--border-width: #{globals.$ion-border-size-025};
Expand Down Expand Up @@ -193,6 +197,21 @@ ion-icon {
color: globals.$ion-primitives-neutral-500;
}

:host(.textarea-disabled.has-focus.ion-valid) {
--border-color: rgba(#{globals.$ion-semantics-success-base-rgb}, 0.6);
}

:host(.textarea-disabled.ion-touched.ion-invalid) {
--border-color: rgba(#{globals.$ion-semantics-danger-base-rgb}, 0.6);
}

:host(.textarea-disabled.has-focus.ion-valid) .textarea-bottom .helper-text,
:host(.textarea-disabled.ion-touched.ion-invalid) .error-text,
:host(.textarea-disabled.ion-color) .textarea-bottom .helper-text,
:host(.textarea-disabled.ion-color) .helper-text {
opacity: 0.6;
}

// Textarea - Readonly
// ----------------------------------------------------------------

Expand Down
9 changes: 8 additions & 1 deletion core/src/components/textarea/textarea.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,18 @@
font-size: globals.dynamic-font(12px);
}

// Textarea Hint Text
// ----------------------------------------------------------------

.textarea-bottom .helper-text {
color: globals.$text-color-step-300;
}

// Textarea Max Length Counter
// ----------------------------------------------------------------

.textarea-bottom .counter {
color: #{globals.$text-color-step-450};
color: globals.$text-color-step-300;

padding-inline-start: 16px;
}
Expand Down
Loading