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

feat(intl-phone-input): add handlers #760

Merged
merged 5 commits into from
Aug 2, 2023
Merged

Conversation

Romkaf
Copy link
Contributor

@Romkaf Romkaf commented Jul 24, 2023

Опишите проблему

При прокидывании хендлеров onClear и onPaste они перетирают логику компонента.

Ожидаемое поведение

Нужно чтобы хендлеры для inputProps вызывались не нарушаю внутреннюю логику хендлеров компонента IntlPhoneInput

@changeset-bot
Copy link

changeset-bot bot commented Jul 24, 2023

🦋 Changeset detected

Latest commit: e83c2e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alfalab/core-components-intl-phone-input Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls
Copy link

coveralls commented Jul 24, 2023

Pull Request Test Coverage Report for Build 5677907222

  • 2 of 3 (66.67%) changed or added relevant lines in 1 file are covered.
  • 53 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.07%) to 79.612%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/intl-phone-input/src/component.tsx 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
packages/calendar/src/components/calendar-mobile/Component.tsx 53 12.09%
Totals Coverage Status
Change from base Build 5610938754: -0.07%
Covered Lines: 8124
Relevant Lines: 9228

💛 - Coveralls

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@@ -459,6 +461,7 @@ export const IntlPhoneInput = forwardRef<HTMLInputElement, IntlPhoneInputProps>(
const resultNumber = preparedNumber.substring(0, maxPhoneLength + 1);

if (resultNumber) {
inputProps?.onPaste?.(event);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему коллбэк вызывается при условии? Он на каждый вызов handlePaste вызываться должен, думаю

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

просто текст из буфера вставляется после проверок выше.
Думаешь правильно вызывать хендлер вставки если текст не вставился в поле по итогу?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю, что да. ИМХО он должен вызываться по событию paste

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

передвинул

@Romkaf Romkaf requested a review from EGNKupava as a code owner July 27, 2023 07:45
@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@v-gevak v-gevak merged commit c68f522 into master Aug 2, 2023
8 checks passed
@v-gevak v-gevak deleted the feat/phone-input-handlers branch August 2, 2023 07:41
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.

7 participants