From dd6f4903bb2a6e0598405c5bae4d428a8e04552d Mon Sep 17 00:00:00 2001 From: henck Date: Wed, 30 Aug 2023 10:23:13 +0100 Subject: [PATCH] Add autocomplete support --- package.json | 2 +- src/controls/Input/Input.tsx | 2 ++ src/controls/Input/StandardInput.tsx | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4c4cf4a4..58ae6664 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@independent-software/typeui", - "version": "1.1.41", + "version": "1.1.42", "description": "TypeUI", "keywords": [ "react", diff --git a/src/controls/Input/Input.tsx b/src/controls/Input/Input.tsx index 9e41b738..9355821e 100644 --- a/src/controls/Input/Input.tsx +++ b/src/controls/Input/Input.tsx @@ -86,6 +86,8 @@ interface IInputProps { clock?: boolean; /** Optional input maxlength */ maxLength?: number; + /** Optional autocomplete information (see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) */ + autocomplete?: string; // Events /** Listeners are notified whenever the user interacts with the Input. */ diff --git a/src/controls/Input/StandardInput.tsx b/src/controls/Input/StandardInput.tsx index 2e74ce5b..8c017cee 100644 --- a/src/controls/Input/StandardInput.tsx +++ b/src/controls/Input/StandardInput.tsx @@ -24,6 +24,7 @@ class StandardInputBase extends React.Component { disabled={p.disabled} type={p.type} maxLength={p.maxLength} + autoComplete={p.autocomplete} onChange={this.handleChange} onFocus={this.props.onFocus}/> ) @@ -128,4 +129,4 @@ const StandardInput = styled(StandardInputBase).attrs(p => ({ } `; -export { StandardInput }; \ No newline at end of file +export { StandardInput } \ No newline at end of file