@humandialog/forms.svelte 1.7.5 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/breadcrumb.svelte +11 -3
- package/package.json +1 -1
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
return idx < entriesNo-maxEntriesNo
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
let containerElement
|
|
46
47
|
let scrollableElement
|
|
47
48
|
/*let isScrolling = false
|
|
48
49
|
let startScrollLeft = 0
|
|
@@ -84,14 +85,21 @@
|
|
|
84
85
|
const elementsNo = pathElements.length
|
|
85
86
|
if(elementsNo > 0)
|
|
86
87
|
{
|
|
87
|
-
|
|
88
|
-
lastElement
|
|
88
|
+
// container: "nearest" not supported on iOS and mobile FF
|
|
89
|
+
//const lastElement = pathElements[elementsNo-1]
|
|
90
|
+
//lastElement.scrollIntoView({ container: "nearest"})
|
|
91
|
+
|
|
92
|
+
const containerRect = containerElement.getBoundingClientRect()
|
|
93
|
+
const wholeWidth = containerElement.scrollWidth
|
|
94
|
+
const visibleWidth = containerRect.width
|
|
95
|
+
containerElement.scrollLeft = wholeWidth - visibleWidth
|
|
96
|
+
|
|
89
97
|
}
|
|
90
98
|
})
|
|
91
99
|
|
|
92
100
|
</script>
|
|
93
101
|
|
|
94
|
-
<nav class="{userClass} w-full sm:w-fit sm:max-w-full overflow-x-auto sm:overflow-x-hidden" aria-label="Breadcrumb">
|
|
102
|
+
<nav class="{userClass} w-full sm:w-fit sm:max-w-full overflow-x-auto sm:overflow-x-hidden" aria-label="Breadcrumb" bind:this={containerElement}>
|
|
95
103
|
<ol class="flex items-center space-x-1 md:space-x-2 rtl:space-x-reverse flex-nowrap min-h-[1.25rem]" bind:this={scrollableElement}>
|
|
96
104
|
|
|
97
105
|
{#if (segments && segments.length > 0)}
|