mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-21 16:25:11 +02:00
feat: Improve container on:navigate
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
</script>
|
||||
|
||||
<Container
|
||||
handleNavigateOut={{
|
||||
left: () => {
|
||||
on:navigate={({ detail }) => {
|
||||
if (detail.direction === 'left' && detail.options.willLeaveContainer) {
|
||||
history.back();
|
||||
return false;
|
||||
detail.preventNavigation();
|
||||
}
|
||||
}}
|
||||
focusOnMount
|
||||
|
||||
@@ -42,10 +42,15 @@
|
||||
<Container class="flex-1 flex">
|
||||
<HeroShowcaseBackground {urls} {index} />
|
||||
<Container
|
||||
handleNavigateOut={{
|
||||
right: onNext,
|
||||
left: onPrevious,
|
||||
up: () => Selectable.giveFocus('left', true) || true
|
||||
on:navigate={({ detail }) => {
|
||||
if (detail.options.direction === 'right') {
|
||||
if (onNext()) detail.preventNavigation();
|
||||
} else if (detail.options.direction === 'left') {
|
||||
if (onPrevious()) detail.preventNavigation();
|
||||
} else if (detail.options.direction === 'up') {
|
||||
Selectable.giveFocus('left', true);
|
||||
detail.preventNavigation();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<div class="flex flex-1 z-10">
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
</script>
|
||||
|
||||
<Container
|
||||
handleNavigateOut={{
|
||||
left: () => {
|
||||
on:navigate={({ detail }) => {
|
||||
if (detail.direction === 'left' && detail.options.willLeaveContainer) {
|
||||
modalStack.close(modalId);
|
||||
return true;
|
||||
detail.preventNavigation();
|
||||
}
|
||||
}}
|
||||
focusOnMount
|
||||
|
||||
@@ -54,8 +54,10 @@
|
||||
<Container
|
||||
class="h-screen flex flex-col py-12 px-20 relative"
|
||||
on:enter={scrollIntoView({ top: 0 })}
|
||||
handleNavigateOut={{
|
||||
down: () => episodesSelectable?.focusChild(1)
|
||||
on:navigate={({ detail }) => {
|
||||
if (detail.direction === 'down') {
|
||||
if (episodesSelectable?.focusChild(1)) detail.preventNavigation();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<HeroCarousel
|
||||
|
||||
@@ -92,7 +92,6 @@
|
||||
</script>
|
||||
|
||||
<Container
|
||||
handleNavigateOut={{}}
|
||||
focusOnMount
|
||||
trapFocus
|
||||
class={classNames('fixed inset-0 bg-black overflow-auto', {
|
||||
|
||||
Reference in New Issue
Block a user