@skyscanner/backpack-web 37.4.0 → 37.4.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode, ElementType, CSSProperties } from 'react';
|
|
1
|
+
import type { ReactNode, ElementType, CSSProperties, UIEvent } from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import type { DebouncedFunc } from 'lodash';
|
|
4
4
|
declare const computeScrollBarAwareHeight: (scrollerEl: HTMLElement | null, innerEl: HTMLElement | null) => string | null;
|
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
scrollerRef?: (el: HTMLElement | null) => void;
|
|
14
14
|
style?: CSSProperties;
|
|
15
15
|
showScrollbar?: boolean;
|
|
16
|
+
onScroll?: (event: UIEvent) => void;
|
|
16
17
|
};
|
|
17
18
|
type State = {
|
|
18
19
|
computedHeight: string;
|
|
@@ -109,6 +109,7 @@ class BpkMobileScrollContainer extends Component {
|
|
|
109
109
|
className,
|
|
110
110
|
innerContainerTagName = 'div',
|
|
111
111
|
leadingIndicatorClassName,
|
|
112
|
+
onScroll,
|
|
112
113
|
scrollerRef,
|
|
113
114
|
showScrollbar,
|
|
114
115
|
style,
|
|
@@ -137,7 +138,12 @@ class BpkMobileScrollContainer extends Component {
|
|
|
137
138
|
}
|
|
138
139
|
this.scrollerEl = el;
|
|
139
140
|
},
|
|
140
|
-
onScroll:
|
|
141
|
+
onScroll: event => {
|
|
142
|
+
this.setScrollIndicatorClassName();
|
|
143
|
+
if (onScroll) {
|
|
144
|
+
onScroll(event);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
141
147
|
className: scrollerClassNames,
|
|
142
148
|
children: /*#__PURE__*/_jsx(InnerContainer, {
|
|
143
149
|
"aria-label": ariaLabel,
|
|
@@ -64,7 +64,7 @@ const BpkNavigationTabGroup = ({
|
|
|
64
64
|
}) => {
|
|
65
65
|
const [selectedTab, setSelectedTab] = useState(selectedIndex);
|
|
66
66
|
const handleButtonClick = (e, tab, index) => {
|
|
67
|
-
if (index !== selectedTab) {
|
|
67
|
+
if (index !== selectedTab && tab.target !== '_blank') {
|
|
68
68
|
setSelectedTab(index);
|
|
69
69
|
}
|
|
70
70
|
onItemClick(e, tab, index);
|