Skip to content

Commit

Permalink
refactor: update input component to increase input width calculation (#…
Browse files Browse the repository at this point in the history
…536)

refactor: update input component to increase input width calculation + remove max-length
  • Loading branch information
melaniebmn authored May 22, 2024
1 parent 02b03df commit d6204f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/web/src/components/gcds-input/gcds-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ export class GcdsInput {
lang,
} = this;

// Use max-width instead of size attribute to keep field responsive
// Use max-width to keep field responsive
const style = {
maxWidth: `${size + (type === 'number' ? 2.5 : 3.75)}ch`,
maxWidth: `${size * 2}ch`,
};

const attrsInput = {
Expand Down Expand Up @@ -402,7 +402,7 @@ export class GcdsInput {
onChange={e => this.handleInput(e, this.gcdsChange)}
aria-labelledby={`label-for-${inputId}`}
aria-invalid={errorMessage ? 'true' : 'false'}
maxlength={size}
size={size}
style={size ? style : null}
ref={element => (this.shadowElement = element as HTMLElement)}
/>
Expand Down

0 comments on commit d6204f3

Please sign in to comment.