willba-component-library 0.1.11 → 0.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -75,13 +75,9 @@
75
75
  position: relative;
76
76
  }
77
77
 
78
- .isMobileAbsolute {
79
- position: absolute;
78
+ .will-root.isMobileAbsolute {
79
+ position: relative;
80
80
  z-index: 99999;
81
81
  }
82
-
83
-
84
-
85
-
86
82
  }
87
83
 
@@ -22,7 +22,7 @@ export interface FilterBarProps {
22
22
  language?: string
23
23
  ageCategories?: AgeCategoryType[]
24
24
  redirectUrl: string
25
- palette: Palette
25
+ palette?: Palette
26
26
  }
27
27
 
28
28
  export default function FilterBar({
@@ -56,12 +56,16 @@ export default function FilterBar({
56
56
  } = useFilterBar({ redirectUrl })
57
57
 
58
58
  // Scroll in to view
59
- const targetElementRef = useRef<HTMLDivElement | null>(null)
59
+
60
+ const targetFilterBarRef = useRef<HTMLDivElement | null>(null)
60
61
  useEffect(() => {
61
- if (targetElementRef.current) {
62
- targetElementRef.current.scrollIntoView({
62
+ if (targetFilterBarRef.current && selectedFilter) {
63
+ window.scrollTo({
63
64
  behavior: 'smooth',
64
- block: 'start',
65
+ top:
66
+ targetFilterBarRef.current.getBoundingClientRect().top -
67
+ document.body.getBoundingClientRect().top -
68
+ 30,
65
69
  })
66
70
  }
67
71
  }, [selectedFilter])
@@ -80,7 +84,7 @@ export default function FilterBar({
80
84
  className={`will-root ${selectedFilter ? 'isMobileAbsolute' : ''}`}
81
85
  style={themePalette}
82
86
  >
83
- <div className="will-filter-bar-header" ref={targetElementRef}>
87
+ <div className="will-filter-bar-header" ref={targetFilterBarRef}>
84
88
  <SelectButton
85
89
  style={fontWigthBold(selectedFilter === 1 || selectedFilter === 2)}
86
90
  label={t('calendar.startDate')}