-
Notifications
You must be signed in to change notification settings - Fork 45
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(input-autocomplete): changed onInput type #1043
Conversation
🦋 Changeset detectedLatest commit: a02ae43 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Собрана новая демка. |
25a0122
to
8737dad
Compare
Собрана новая демка. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо бы оповестить ребят, чтобы они были готовы к мажорке. Ну и можно обсудить с ними, чтобы вопросов не было.
(event, payload) — вообще оказалось плохой идеей. Хотя это как раз пример, когда коллективно сделали ошибочный выбор :D
8737dad
to
a02ae43
Compare
Pull Request Test Coverage Report for Build 7813320069
💛 - Coveralls |
Собрана новая демка. |
Что сделано
Изменен тип onInput коллбэка с
(event: ChangeEvent | null, payload: {value:string}) => void
на(value: string) => void
Зачем
Возникают проблемы с event === null
Разработчики часто завязываются именно на первый аргумент коллбэков, игнорируют второй
И если event пришел null, то непонятно какой из этого вывод должен сделать разработчик
Отсюда вытекает подобный код:
но это совершенно не равнозначно коду (особенно в случае input-autocomplete)
что само собой порождает ошибки