Skip to content

Commit a56f046

Browse files
nitzanyizInbal-Tish
authored andcommitted
ExpandableCalendar - default header height (#2641)
1 parent 07ca886 commit a56f046

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/expandableCalendar/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const PAN_GESTURE_THRESHOLD = 30;
5454
const LEFT_ARROW = require('../calendar/img/previous.png');
5555
const RIGHT_ARROW = require('../calendar/img/next.png');
5656
const knobHitSlop = {left: 10, right: 10, top: 10, bottom: 10};
57+
const DEFAULT_HEADER_HEIGHT = 78;
5758

5859
export interface ExpandableCalendarProps extends CalendarListProps {
5960
/** the initial position of the calendar ('open' or 'closed') */
@@ -143,7 +144,7 @@ const ExpandableCalendar = forwardRef<ExpandableCalendarRef, ExpandableCalendarP
143144
const [screenReaderEnabled, setScreenReaderEnabled] = useState(false);
144145
const [headerHeight, setHeaderHeight] = useState(0);
145146
const onHeaderLayout = useCallback(({nativeEvent: {layout: {height}}}: LayoutChangeEvent) => {
146-
setHeaderHeight(height);
147+
setHeaderHeight(height || DEFAULT_HEADER_HEIGHT);
147148
}, []);
148149

149150
/** Date */

0 commit comments

Comments
 (0)