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: focusOptions changes, replaced focusName - with field and index, added focusOptions to all array methods #107

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

TheKucel
Copy link
Collaborator

@TheKucel TheKucel commented Nov 7, 2024

Обновлённые focusOptions для v3

описание из pr для v2

Поменял focusOptions, убрал focusName, и добавил field и index как 2 отдельных поля
Так же добавил focusOptions для каждого метода массива, и установил дефолтные индексы при передаче field
(Дефолтный индекс срабатывает если передаём название поля, но не передаём индекс)

Дефолтный индекс указывал по следующему принципу - "то что последнее изменили"

append - фокус на добавленное (последнее) поле
insert - фокус на добавленное (указанное) поле
move - фокус на перемещённое (to) поле
swap - фокус на перемещённое (to) поле
remove - фокус на предыдущее (если нет предыдущего то на первое) поле
+Покрыл это тестами

@TheKucel TheKucel requested a review from leonied7 November 7, 2024 10:51
Copy link

netlify bot commented Nov 7, 2024

Deploy Preview for vue-validate-form ready!

Name Link
🔨 Latest commit d88c95c
🔍 Latest deploy log https://app.netlify.com/sites/vue-validate-form/deploys/6735bd774450870008b6626c
😎 Deploy Preview https://deploy-preview-107--vue-validate-form.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -217,6 +242,9 @@ export default {
methods: {
onSubmit(values, options) {
this.$emit('submit', values, options);
},
handleFocus({ name }) {
document.querySelector(`[name="${name}"]`)?.focus();
Copy link
Owner

Choose a reason for hiding this comment

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

Лучше выкидывать событие и проверять через https://test-utils.vuejs.org/api/#emitted

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, если правильно тебя понял, то теперь откидываю эмиты наверх и считываю было ли в последнем эмите то что мне надо

Boris Andreiko added 3 commits November 8, 2024 18:12
@leonied7
Copy link
Owner

@TheKucel есть ошибки билда

@TheKucel TheKucel merged commit feb7c05 into master Nov 19, 2024
7 checks passed
@TheKucel TheKucel deleted the v3-change-focus-options branch November 19, 2024 16:18
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.

2 participants