fix(input, textarea, select): do not show highlight in item (#26689)

resolves #26687
This commit is contained in:
Liam DeBeasi
2023-01-26 15:17:54 -05:00
committed by GitHub
parent d0dc45c3d6
commit 16b60a612c
13 changed files with 9 additions and 6 deletions

View File

@@ -640,7 +640,8 @@ export class Input implements ComponentInterface {
const { disabled, fill, readonly, shape, inputId, labelPlacement } = this;
const mode = getIonStylesheet(this);
const value = this.getValue();
const shouldRenderHighlight = mode === 'md' && fill !== 'outline';
const inItem = hostContext('ion-item', this.el);
const shouldRenderHighlight = mode === 'md' && fill !== 'outline' && !inItem;
return (
<Host
@@ -652,7 +653,7 @@ export class Input implements ComponentInterface {
[`input-fill-${fill}`]: fill !== undefined,
[`input-shape-${shape}`]: shape !== undefined,
[`input-label-placement-${labelPlacement}`]: true,
'in-item': hostContext('ion-item', this.el),
'in-item': inItem,
'in-item-color': hostContext('ion-item.ion-color', this.el),
})}
>

View File

@@ -730,14 +730,15 @@ export class Select implements ComponentInterface {
const hasFloatingOrStackedLabel = labelPlacement === 'floating' || labelPlacement === 'stacked';
const justifyEnabled = !hasFloatingOrStackedLabel;
const rtl = isRTL(el) ? 'rtl' : 'ltr';
const shouldRenderHighlight = mode === 'md' && fill !== 'outline';
const inItem = hostContext('ion-item', this.el);
const shouldRenderHighlight = mode === 'md' && fill !== 'outline' && !inItem;
return (
<Host
onClick={this.onClick}
class={createColorClasses(this.color, {
[mode]: true,
'in-item': hostContext('ion-item', el),
'in-item': inItem,
'select-disabled': disabled,
'select-expanded': isExpanded,
'has-value': this.hasValue(),

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -8,7 +8,7 @@ import { createLegacyFormController } from '../../utils/forms';
import type { Attributes } from '../../utils/helpers';
import { inheritAriaAttributes, debounceEvent, findItemLabel, inheritAttributes } from '../../utils/helpers';
import { printIonWarning } from '../../utils/logging';
import { createColorClasses } from '../../utils/theme';
import { createColorClasses, hostContext } from '../../utils/theme';
import { getCounterText } from '../input/input.utils';
/**
@@ -603,7 +603,8 @@ For textareas that do not have a visible label, developers should use "aria-labe
const { inputId, disabled, fill, shape, labelPlacement } = this;
const mode = getIonStylesheet(this);
const value = this.getValue();
const shouldRenderHighlight = mode === 'md' && fill !== 'outline';
const inItem = hostContext('ion-item', this.el);
const shouldRenderHighlight = mode === 'md' && fill !== 'outline' && !inItem;
return (
<Host