Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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.
25 changes: 25 additions & 0 deletions core/src/components/textarea/test/states/textarea.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,31 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, screensh
await expect(container).toHaveScreenshot(screenshot(`textarea-readonly-no-fill`));
});
});

test.describe(title('solid'), () => {
test('should render readonly invalid textarea correctly', async ({ page }) => {
await page.setContent(
`
<div class="container">
<ion-textarea
label="Email"
label-placement="stacked"
value="[email protected]"
helper-text="Enter an email"
counter="true"
maxlength="20"
class="ion-touched ion-invalid"
readonly="true"
></ion-textarea>
</div>
`,
config
);

const container = page.locator('.container');
await expect(container).toHaveScreenshot(screenshot(`textarea-readonly-solid-invalid`));
});
});
});
});
});
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.
15 changes: 12 additions & 3 deletions core/src/components/textarea/textarea.ionic.outline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,18 @@
margin-top: globals.$ion-space-100;
}

// Input Focus
// Focus
// ----------------------------------------------------------------

:host(.textarea-fill-outline.has-focus) {
--border-width: #{globals.$ion-border-size-050};
:host(.textarea-fill-outline.has-focus.ion-valid),
:host(.textarea-fill-outline.ion-touched.ion-invalid) {
--border-color: var(--highlight-color);
}

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

:host(.textarea-fill-outline.textarea-readonly) {
--border-color: #{globals.$ion-border-input-default};
--border-width: #{globals.$ion-border-size-025};
}
16 changes: 9 additions & 7 deletions core/src/components/textarea/textarea.ionic.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./textarea.common";
@use "./textarea.ionic.outline.scss" as outline;
@use "./textarea.ionic.solid.scss" as solid;

// Ionic Textarea
// --------------------------------------------------
Expand Down Expand Up @@ -122,7 +123,7 @@
// ----------------------------------------------------------------

ion-icon {
color: globals.$ion-primitives-neutral-800;
--color: globals.$ion-icon-subtlest;

font-size: globals.$ion-scale-400;
}
Expand Down Expand Up @@ -177,6 +178,7 @@ ion-icon {

:host(.has-focus) {
--border-color: #{globals.$ion-border-focus-default};
--border-width: #{globals.$ion-border-size-050};
}

:host(.has-focus) .textarea-highlight {
Expand All @@ -188,18 +190,18 @@ ion-icon {

@media (any-hover: hover) {
:host(:hover) {
--border-color: #{globals.$ion-primitives-neutral-600};
--border-color: #{globals.$ion-border-focus-default};
}
}

// Textarea - Disabled
// ----------------------------------------------------------------

:host(.textarea-disabled) {
--color: #{globals.$ion-primitives-neutral-500};
--background: #{globals.$ion-primitives-neutral-100};
--border-color: #{globals.$ion-primitives-neutral-300};
--placeholder-color: #{globals.$ion-primitives-neutral-500};
--color: #{globals.$ion-text-disabled};
--background: #{globals.$ion-bg-input-disabled};
--border-color: #{globals.$ion-border-disabled};
--placeholder-color: #{globals.$ion-text-disabled};
}

:host(.textarea-disabled:not(.ion-valid)) .textarea-bottom .helper-text,
Expand Down Expand Up @@ -229,7 +231,7 @@ ion-icon {
// ----------------------------------------------------------------

:host(.textarea-readonly) {
--background: #{globals.$ion-primitives-neutral-100};
--background: #{globals.$ion-bg-input-read-only};
}

/**
Expand Down
62 changes: 62 additions & 0 deletions core/src/components/textarea/textarea.ionic.solid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;

// Ionic Textarea Fill: Solid
// ----------------------------------------------------------------

:host(.textarea-fill-solid) {
--border-color: #{globals.$ion-bg-input-bold-default};
--border-width: #{globals.$ion-border-size-050};
--background: #{globals.$ion-bg-input-bold-default};
}

:host(.textarea-fill-solid) .textarea-wrapper {
border-bottom: none;

background: none;
}

:host(.textarea-fill-solid) .textarea-wrapper-inner {
@include globals.border-radius(var(--border-radius));
position: relative;

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

background: var(--background);
}

:host(.textarea-fill-solid) .textarea-bottom {
--border-width: #{globals.$ion-scale-0};
}

// Focus
// ----------------------------------------------------------------

:host(.textarea-fill-solid.has-focus) {
--border-color: #{globals.$ion-border-focus-default};
}

:host(.textarea-fill-solid.has-focus.ion-valid),
:host(.textarea-fill-solid.ion-touched.ion-invalid) {
--border-width: #{globals.$ion-border-size-050};
--border-color: var(--highlight-color);
}

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

:host(.textarea-fill-solid.textarea-readonly) {
--background: #{globals.$ion-bg-input-bold-read-only};
--border-color: #{globals.$ion-bg-input-bold-read-only};
}

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

// Textarea - Disabled
// ----------------------------------------------------------------

:host(.textarea-fill-solid.textarea-disabled) {
--background: #{globals.$ion-bg-input-bold-disabled};
--border-color: #{globals.$ion-bg-input-bold-disabled};
}
2 changes: 1 addition & 1 deletion core/src/components/textarea/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ export class Textarea implements ComponentInterface {
const shape = this.getShape();
const value = this.getValue();
const inItem = hostContext('ion-item', this.el);
const shouldRenderHighlight = (theme === 'md' || theme === 'ionic') && fill !== 'outline' && !inItem;
const shouldRenderHighlight = theme === 'md' && fill !== 'outline' && !inItem;

const hasValue = this.hasValue();
const hasStartEndSlots = el.querySelector('[slot="start"], [slot="end"]') !== null;
Expand Down
Loading