Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
621dc13
feat(input): add new js and css props
liamdebeasi Oct 31, 2022
d24428c
chore(): copy updates
liamdebeasi Oct 31, 2022
0402ae8
test(input): move old tests to legacy directory
liamdebeasi Oct 31, 2022
7643d2d
feat(input): add legacy vs modern template rendering
liamdebeasi Oct 31, 2022
259a3a2
refactor(form): add form controller
liamdebeasi Oct 31, 2022
a989e94
chore(): update comments
liamdebeasi Oct 31, 2022
2a80a5f
chore(): update tests
liamdebeasi Oct 31, 2022
08ea3a0
chore(): add moved screenshots
liamdebeasi Oct 31, 2022
bd80054
chore(): add moved screenshots
liamdebeasi Oct 31, 2022
19f4994
chore(): fix test file
liamdebeasi Oct 31, 2022
d02c144
chore(): prettier
liamdebeasi Oct 31, 2022
cea5615
feat(input): add base functionality and tests
liamdebeasi Oct 31, 2022
8d7f0c4
feat(input): add missing fixed label
liamdebeasi Oct 31, 2022
fff8ed1
Merge remote-tracking branch 'origin/FW-2591' into 2591-props
liamdebeasi Nov 1, 2022
563f177
Update core/src/components/input/input.tsx
liamdebeasi Nov 1, 2022
e1696af
chore(): run build
liamdebeasi Nov 1, 2022
a17a9ae
Merge remote-tracking branch 'origin/2591-props' into 2591-template
liamdebeasi Nov 1, 2022
b458fe7
Merge remote-tracking branch 'origin/2591-template' into 2591-base
liamdebeasi Nov 1, 2022
f556aee
chore(input): remove justify property
liamdebeasi Nov 1, 2022
6b8131a
Update core/src/components/input/input.tsx
liamdebeasi Nov 2, 2022
e0b5cd6
feat(input): add missing fill property
liamdebeasi Nov 2, 2022
5a0f812
refactor(): explicitly add element type
liamdebeasi Nov 2, 2022
2bf7b10
test(input): mask test uses new syntax
liamdebeasi Nov 2, 2022
1cc337a
refactor(input): access props once
liamdebeasi Nov 2, 2022
4272366
chore(): fix el type
liamdebeasi Nov 2, 2022
6d09ad6
Merge remote-tracking branch 'origin/2591-props' into 2591-template
liamdebeasi Nov 2, 2022
9632c22
Merge remote-tracking branch 'origin/2591-template' into 2591-base
liamdebeasi Nov 2, 2022
4814a58
chore(): sync
liamdebeasi Nov 7, 2022
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
67 changes: 66 additions & 1 deletion core/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,72 @@ export class Input implements ComponentInterface {
}

private renderInput() {
return <Host>Stubbed input</Host>;
const { disabled, readonly, inputId } = this;
const mode = getIonMode(this);
const value = this.getValue();

return (
<Host
aria-disabled={disabled ? 'true' : null}
class={createColorClasses(this.color, {
[mode]: true,
'has-value': this.hasValue(),
'has-focus': this.hasFocus,
})}
>
<label htmlFor={inputId}>{this.label}</label>
<input
class="native-input"
ref={(input) => (this.nativeInput = input)}
id={inputId}
disabled={disabled}
accept={this.accept}
autoCapitalize={this.autocapitalize}
autoComplete={this.autocomplete}
autoCorrect={this.autocorrect}
autoFocus={this.autofocus}
enterKeyHint={this.enterkeyhint}
inputMode={this.inputmode}
min={this.min}
max={this.max}
minLength={this.minlength}
maxLength={this.maxlength}
multiple={this.multiple}
name={this.name}
pattern={this.pattern}
placeholder={this.placeholder || ''}
readOnly={readonly}
required={this.required}
spellcheck={this.spellcheck}
step={this.step}
size={this.size}
type={this.type}
value={value}
onInput={this.onInput}
onChange={this.onChange}
onBlur={this.onBlur}
onFocus={this.onFocus}
onKeyDown={this.onKeydown}
{...this.inheritedAttributes}
/>
{this.clearInput && !readonly && !disabled && (
<button
aria-label="reset"
type="button"
class="input-clear-icon"
onPointerDown={(ev) => {
/**
* This prevents mobile browsers from
* blurring the input when the clear
* button is activated.
*/
ev.preventDefault();
}}
onClick={this.onClearButtonClick}
/>
)}
</Host>
);
}

private renderLegacyInput() {
Expand Down
22 changes: 22 additions & 0 deletions core/src/components/input/test/a11y/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Input - a11y</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
<script src="../../../../../scripts/testing/scripts.js"></script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
</head>

<body>
<main>
<h1>Input - a11y</h1>

<ion-input label="my label"></ion-input>
<ion-input aria-label="my aria label"></ion-input>
</main>
</body>
</html>