Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Auto Capitalize inputs #58

Open
andyrue opened this issue Nov 18, 2021 · 3 comments
Open

Add Option to Auto Capitalize inputs #58

andyrue opened this issue Nov 18, 2021 · 3 comments
Labels
enhancement New feature or request in progress

Comments

@andyrue
Copy link

andyrue commented Nov 18, 2021

It would be nice to have an option to auto capitalize inputs as they get typed in. The autocapitalize attribute has been added, but this is only used for virtual keyboards and has limited browser support. A better way would be to handle this inside the component, observing inputs and capitalizing them as they come in.

@AlexMiniApps
Copy link
Owner

@andyrue I guess I will additional setting for the component.

@AlexMiniApps AlexMiniApps added in progress enhancement New feature or request labels Nov 26, 2021
@hkaiser25
Copy link

Any update on this? I need my input to be automatically capitalized.

@AlexMiniApps
Copy link
Owner

@hkaiser25 Unfortunately I don't have a time to focus on the library. I am planning to complete it but not now. As a temporary solution you can do the following:
In HTML:
<code-input ... [code]="code" (codeChanged)="onCodeChanged($event)" (codeCompleted)="onCodeCompleted($event)"> </code-input>
In the code:

...
  public code = '';
...
  public async onCodeChanged(code: string): Promise<void> {
    this.code = code;
    await new Promise(resolve => setTimeout(resolve, 50));
    this.code = code.toLocaleUpperCase();
  }

  public onCodeCompleted(code: string): void {
    const value = code.toLocaleUpperCase();
    ...
  } 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

3 participants