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

fix(kit): maskitoCaretGuard doesn't work after focus on <select /> #462

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

nsbarsukov
Copy link
Member

@nsbarsukov nsbarsukov commented Aug 30, 2023

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Code style update
  • Build or CI related changes
  • Documentation content changes

What is the current behavior?

  1. Use Firefox or Safari

  2. Run

import {ChangeDetectionStrategy, Component} from '@angular/core';
import {maskitoCaretGuard, maskitoNumberOptionsGenerator} from '@maskito/kit';

const numberOptions = maskitoNumberOptionsGenerator({
    postfix: `$`,
});

@Component({
    selector: 'test-doc-example-5',
    template: `
        <input
            value="100$"
            [maskito]="numberMask"
        />

        <select>
            <option>1</option>
            <option>2</option>
            <option>3</option>
        </select>
    `,
    changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TestDocExample5 {
    readonly numberMask = {
        ...numberOptions,
        plugins: [
            ...numberOptions.plugins,
            maskitoCaretGuard(value => [0, value.length - 1]),
        ],
    };
}
firefox.mov

See also:

What is the new behavior?

Closes taiga-family/taiga-ui#5233

Does this PR introduce a breaking change?

  • Yes
  • No

@github-actions
Copy link
Contributor

Visit the preview URL for this PR (updated for commit 35d14c8):

https://maskito--pr462-caret-guard-bug-xsf9wbs7.web.app

(expires Thu, 31 Aug 2023 15:33:20 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 61e4dea776cbea516b68c67840913d2edd88bb90

@nsbarsukov nsbarsukov merged commit 9f456da into main Aug 30, 2023
17 checks passed
@nsbarsukov nsbarsukov deleted the caret-guard-bug branch August 30, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 - incorrect carriage position when focusing in tui-input-number
2 participants