diff --git a/core/src/components/checkbox/checkbox.tsx b/core/src/components/checkbox/checkbox.tsx
index 490c38ddbd..0b8bb796b8 100644
--- a/core/src/components/checkbox/checkbox.tsx
+++ b/core/src/components/checkbox/checkbox.tsx
@@ -1,6 +1,6 @@
import { Component, Element, Event, EventEmitter, Prop, State, Watch } from '@stencil/core';
import { CheckboxInput, CheckedInputChangeEvent, Color, Mode, StyleEvent } from '../../interface';
-import { deferEvent } from '../../utils/helpers';
+import { deferEvent, renderHiddenInput } from '../../utils/helpers';
import { createColorClasses, hostContext } from '../../utils/theme';
@@ -129,6 +129,8 @@ export class Checkbox implements CheckboxInput {
}
render() {
+ renderHiddenInput(this.el, this.name, this.value, this.disabled);
+
return [
diff --git a/core/src/components/content/content.scss b/core/src/components/content/content.scss
index cd6e3c32ff..48e63cf2c9 100644
--- a/core/src/components/content/content.scss
+++ b/core/src/components/content/content.scss
@@ -21,6 +21,7 @@
height: 100%;
/* stylelint-disable */
+ /* TODO: find a better solution in padding.css, that does not require !important, */
margin: 0 !important;
padding: 0 !important;
diff --git a/core/src/components/input/input.scss b/core/src/components/input/input.scss
index 2d378e22e7..78197b8a38 100644
--- a/core/src/components/input/input.scss
+++ b/core/src/components/input/input.scss
@@ -18,6 +18,11 @@
align-items: center;
width: 100%;
+
+ /* stylelint-disable */
+ /* TODO: find a better solution in padding.css, that does not require !important, */
+ padding: 0 !important;
+ /* stylelint-enable */
}
@@ -55,15 +60,16 @@
font-family: inherit;
font-weight: var(--placeholder-weight);
}
+
+ &:-webkit-autofill {
+ background-color: transparent;
+ }
}
.native-input[disabled] {
opacity: .4;
}
-.native-input:-webkit-autofill {
- background-color: transparent;
-}
// Input Cover: Unfocused
@@ -99,16 +105,13 @@
border: 0;
+ outline: none;
+
background-color: transparent;
background-repeat: no-repeat;
visibility: hidden;
appearance: none;
-
- &:active,
- &:focus {
- outline: none;
- }
}
:host(.has-focus.has-value) .input-clear-icon {
diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx
index 852e72e352..d99177d1a9 100644
--- a/core/src/components/input/input.tsx
+++ b/core/src/components/input/input.tsx
@@ -1,6 +1,6 @@
import { Component, Element, Event, EventEmitter, Prop, State, Watch } from '@stencil/core';
import { Color, InputChangeEvent, Mode, StyleEvent } from '../../interface';
-import { debounceEvent, deferEvent } from '../../utils/helpers';
+import { debounceEvent, deferEvent, renderHiddenInput } from '../../utils/helpers';
import { hostContext } from '../../utils/theme';
import { InputComponent } from './input-base';
@@ -16,6 +16,7 @@ import { InputComponent } from './input-base';
export class Input implements InputComponent {
private nativeInput?: HTMLInputElement;
+ private inputId = `ion-input-${inputIds++}`;
didBlurAfterEdit = false;
mode!: Mode;
@@ -148,7 +149,7 @@ export class Input implements InputComponent {
/**
* The name of the control, which is submitted with the form data.
*/
- @Prop() name?: string;
+ @Prop() name: string = this.inputId;
/**
* A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `"text"`, `"search"`, `"tel"`, `"url"`, `"email"`, or `"password"`, otherwise it is ignored.
@@ -276,14 +277,10 @@ export class Input implements InputComponent {
}
}
- private inputKeydown() {
- this.checkClearOnEdit();
- }
-
/**
* Check if we need to clear the text input if clearOnEdit is enabled
*/
- private checkClearOnEdit() {
+ private onKeydown() {
if (!this.clearOnEdit) {
return;
}
@@ -317,7 +314,7 @@ export class Input implements InputComponent {
}
render() {
- // TODO aria-labelledby={this.item.labelId}
+ renderHiddenInput(this.el, this.name, this.value, this.disabled);
return [
,
+
,
this.clearInput &&
,
-
+
];
}
}
diff --git a/core/src/components/textarea/textarea.tsx b/core/src/components/textarea/textarea.tsx
index 848d3c22ef..18495cf81f 100644
--- a/core/src/components/textarea/textarea.tsx
+++ b/core/src/components/textarea/textarea.tsx
@@ -1,6 +1,6 @@
import { Component, Element, Event, EventEmitter, Prop, State, Watch } from '@stencil/core';
import { Color, InputChangeEvent, Mode, StyleEvent } from '../../interface';
-import { debounceEvent, deferEvent } from '../../utils/helpers';
+import { debounceEvent, deferEvent, renderHiddenInput } from '../../utils/helpers';
import { TextareaComponent } from '../input/input-base';
@@ -15,6 +15,7 @@ import { TextareaComponent } from '../input/input-base';
export class Textarea implements TextareaComponent {
private inputEl?: HTMLTextAreaElement;
+ private inputId = `ion-input-${textareaIds++}`;
mode!: Mode;
color?: Color;
@@ -103,7 +104,7 @@ export class Textarea implements TextareaComponent {
/**
* The name of the control, which is submitted with the form data.
*/
- @Prop() name?: string;
+ @Prop() name: string = this.inputId;
/**
* Instructional text that shows before the input has a value.
@@ -229,6 +230,8 @@ export class Textarea implements TextareaComponent {
}
render() {
+ renderHiddenInput(this.el, this.name, this.value, this.disabled);
+
return (