Skip to content

Commit 94072e6

Browse files
macandcheesebenelan
authored andcommitted
feat(input): Improve display of resize handle for type textarea (#10866)
**Related Issue:** #10864 ## Summary Removes the custom grab handle icon for Input in type textarea. This defers to the browser and matches the design of the Text Area component, which is the recommended migration from this "deprecated" textarea type of Input (related: #9974) <img width="837" alt="Screenshot 2024-11-25 at 10 37 27 AM" src="https://github.com/user-attachments/assets/0f43d187-480a-4cab-b871-af1557c1d8bc">
1 parent 7bdb0e0 commit 94072e6

File tree

3 files changed

+41
-88
lines changed

3 files changed

+41
-88
lines changed

packages/calcite-components/src/components/input/input.scss

+1-38
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ input:focus {
233233
block;
234234
}
235235

236-
.icon,
237-
.resize-icon-wrapper {
236+
.icon {
238237
@apply z-default; // needed for firefox to display the icon properly
239238
}
240239

@@ -501,42 +500,6 @@ input[type="date"]::-webkit-input-placeholder {
501500
visibility: hidden !important;
502501
}
503502

504-
// textarea resize icon
505-
textarea::-webkit-resizer {
506-
@apply absolute
507-
bottom-0
508-
box-border
509-
py-0
510-
px-1;
511-
inset-inline-end: 0;
512-
}
513-
514-
.resize-icon-wrapper {
515-
inset-block-end: 2px;
516-
inset-inline-end: 2px;
517-
518-
@apply bg-foreground-1
519-
text-color-3
520-
pointer-events-none
521-
absolute
522-
h-3
523-
w-3;
524-
525-
& calcite-icon {
526-
inset-block-end: theme("spacing.1");
527-
inset-inline-end: theme("spacing.1");
528-
transform: rotate(-45deg);
529-
}
530-
}
531-
532-
.calcite--rtl {
533-
.resize-icon-wrapper {
534-
& calcite-icon {
535-
transform: rotate(45deg);
536-
}
537-
}
538-
}
539-
540503
:host([type="color"]) input {
541504
@apply p-1;
542505
}

packages/calcite-components/src/components/input/input.tsx

+40-49
Original file line numberDiff line numberDiff line change
@@ -1094,55 +1094,46 @@ export class Input
10941094
: (literal`textarea` as unknown as "textarea");
10951095

10961096
const childEl =
1097-
this.type !== "number"
1098-
? [
1099-
<DynamicHtmlTag
1100-
accept={this.accept}
1101-
aria-errormessage={IDS.validationMessage}
1102-
ariaInvalid={this.status === "invalid"}
1103-
ariaLabel={getLabelText(this)}
1104-
autocomplete={this.autocomplete as LuminaJsx.HTMLElementTags["input"]["autocomplete"]}
1105-
autofocus={autofocus}
1106-
class={{
1107-
[CSS.editingEnabled]: this.editingEnabled,
1108-
[CSS.inlineChild]: !!this.inlineEditableEl,
1109-
}}
1110-
defaultValue={this.defaultValue}
1111-
disabled={this.disabled ? true : null}
1112-
enterKeyHint={enterKeyHint as LuminaJsx.HTMLElementTags["input"]["enterKeyHint"]}
1113-
inputMode={inputMode as LuminaJsx.HTMLElementTags["input"]["inputMode"]}
1114-
max={this.maxString}
1115-
maxLength={this.maxLength}
1116-
min={this.minString}
1117-
minLength={this.minLength}
1118-
multiple={this.multiple}
1119-
name={this.name}
1120-
onBlur={this.inputBlurHandler}
1121-
onChange={this.inputChangeHandler}
1122-
onFocus={this.inputFocusHandler}
1123-
onInput={this.inputInputHandler}
1124-
onKeyDown={this.inputKeyDownHandler}
1125-
onKeyUp={this.inputKeyUpHandler}
1126-
pattern={this.pattern}
1127-
placeholder={this.placeholder || ""}
1128-
readOnly={this.readOnly}
1129-
ref={this.setChildElRef}
1130-
required={this.required ? true : null}
1131-
spellcheck={this.el.spellcheck}
1132-
step={this.step}
1133-
tabIndex={
1134-
this.disabled || (this.inlineEditableEl && !this.editingEnabled) ? -1 : null
1135-
}
1136-
type={this.type}
1137-
value={this.value}
1138-
/>,
1139-
this.isTextarea ? (
1140-
<div class={CSS.resizeIconWrapper}>
1141-
<calcite-icon icon="chevron-down" scale={getIconScale(this.scale)} />
1142-
</div>
1143-
) : null,
1144-
]
1145-
: null;
1097+
this.type !== "number" ? (
1098+
<DynamicHtmlTag
1099+
accept={this.accept}
1100+
aria-errormessage={IDS.validationMessage}
1101+
ariaInvalid={this.status === "invalid"}
1102+
ariaLabel={getLabelText(this)}
1103+
autocomplete={this.autocomplete as LuminaJsx.HTMLElementTags["input"]["autocomplete"]}
1104+
autofocus={autofocus}
1105+
class={{
1106+
[CSS.editingEnabled]: this.editingEnabled,
1107+
[CSS.inlineChild]: !!this.inlineEditableEl,
1108+
}}
1109+
defaultValue={this.defaultValue}
1110+
disabled={this.disabled ? true : null}
1111+
enterKeyHint={enterKeyHint as LuminaJsx.HTMLElementTags["input"]["enterKeyHint"]}
1112+
inputMode={inputMode as LuminaJsx.HTMLElementTags["input"]["inputMode"]}
1113+
max={this.maxString}
1114+
maxLength={this.maxLength}
1115+
min={this.minString}
1116+
minLength={this.minLength}
1117+
multiple={this.multiple}
1118+
name={this.name}
1119+
onBlur={this.inputBlurHandler}
1120+
onChange={this.inputChangeHandler}
1121+
onFocus={this.inputFocusHandler}
1122+
onInput={this.inputInputHandler}
1123+
onKeyDown={this.inputKeyDownHandler}
1124+
onKeyUp={this.inputKeyUpHandler}
1125+
pattern={this.pattern}
1126+
placeholder={this.placeholder || ""}
1127+
readOnly={this.readOnly}
1128+
ref={this.setChildElRef}
1129+
required={this.required ? true : null}
1130+
spellcheck={this.el.spellcheck}
1131+
step={this.step}
1132+
tabIndex={this.disabled || (this.inlineEditableEl && !this.editingEnabled) ? -1 : null}
1133+
type={this.type}
1134+
value={this.value}
1135+
/>
1136+
) : null;
11461137

11471138
return (
11481139
<InteractiveContainer disabled={this.disabled}>

packages/calcite-components/src/components/input/resources.ts

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export const CSS = {
1111
wrapper: "element-wrapper",
1212
inputWrapper: "wrapper",
1313
actionWrapper: "action-wrapper",
14-
resizeIconWrapper: "resize-icon-wrapper",
1514
numberButtonItem: "number-button-item",
1615
};
1716

0 commit comments

Comments
 (0)