feat(alert): add support for textarea (#16851)

resolves #14153
This commit is contained in:
Tawfiek Khalaf
2019-11-11 21:27:45 +02:00
committed by Liam DeBeasi
parent bef0f53d0d
commit b28cf02ef3
10 changed files with 83 additions and 22 deletions

View File

@ -373,25 +373,46 @@ export class Alert implements ComponentInterface, OverlayInterface {
}
return (
<div class="alert-input-group" aria-labelledby={labelledby}>
{ inputs.map(i => (
<div class="alert-input-wrapper">
<input
placeholder={i.placeholder}
value={i.value}
type={i.type}
min={i.min}
max={i.max}
onInput={e => i.value = (e.target as any).value}
id={i.id}
disabled={i.disabled}
tabIndex={0}
class={{
'alert-input': true,
'alert-input-disabled': i.disabled || false
}}
/>
</div>
))}
{ inputs.map(i => {
if (i.type === 'textarea') {
return (
<div class="alert-input-wrapper">
<textarea
placeholder={i.placeholder}
value={i.value}
onInput={e => i.value = (e.target as any).value}
id={i.id}
disabled={i.disabled}
tabIndex={0}
class={{
'alert-input': true,
'alert-input-disabled': i.disabled || false
}}
/>
</div>
);
} else {
return (
<div class="alert-input-wrapper">
<input
placeholder={i.placeholder}
value={i.value}
type={i.type}
min={i.min}
max={i.max}
onInput={e => i.value = (e.target as any).value}
id={i.id}
disabled={i.disabled}
tabIndex={0}
class={{
'alert-input': true,
'alert-input-disabled': i.disabled || false
}}
/>
</div>
);
}
})}
</div>
);
}