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: no focus after display horizontal paging page content #330

Merged
merged 7 commits into from
Jan 15, 2024

Conversation

pspaczek
Copy link
Contributor

@pspaczek pspaczek commented Jan 10, 2024

New focus functionality in this PR.

  • When you use menu item and move to the "Item" content focus will be set before "Item" content.
  • When you back from "Item" to menu, menu item will be focused.

@pspaczek pspaczek requested a review from AlanLes January 10, 2024 14:17
@@ -226,6 +226,7 @@ const menuItems = computed<MenuItemAttrsProps[]>(() => itemsAsArray.value.map((i
item,
];
},
tabindex: isActive.value ? '-1' : null,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AlanLes I have one TS error; Can you help me and know how to fix it?

Copy link
Contributor

@AlanLes AlanLes Jan 11, 2024

Choose a reason for hiding this comment

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

Hello, sure what's the error? :)
kkk, I'm on it :)

@@ -226,6 +226,7 @@ const menuItems = computed<MenuItemAttrsProps[]>(() => itemsAsArray.value.map((i
item,
];
},
tabindex: isActive.value ? '-1' : null,
Copy link
Contributor

@AlanLes AlanLes Jan 11, 2024

Choose a reason for hiding this comment

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

It does the job :)

Suggested change
tabindex: isActive.value ? '-1' : null,
tabindex: isActive.value ? '-1' : undefined,

tabindex doesn't seem to accept the null value :)

but I'm not sure if it wouldn't be better to implicitly not set the tabindex property at all... instead of setting it to undefined.
It could be done with this line instead:

Suggested change
tabindex: isActive.value ? '-1' : null,
...(isActive.value ? { tabindex: '-1' } : {}),

@pspaczek pspaczek changed the title fix: no focus after open new page fix: no focus after display horizontal paging page content Jan 15, 2024
@pspaczek pspaczek merged commit f01a871 into infermedica:develop Jan 15, 2024
2 checks passed
@pspaczek pspaczek deleted the fix/#329 branch January 15, 2024 14:44
pspaczek added a commit that referenced this pull request Jan 15, 2024
* fix: no focus after open new page

* feat: focus menu button on back

* fix(ts): tabindex in menuItems

* fix: use nextTick to prevent to fast focusing

* fix(ts): solve TS18047 and TS2464 errors

* fix(ts): solve TS7053 error
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