Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import measureTooltipCoordinate, {getTooltipCoordinates} from './measureTooltipC

type LayoutChangeEventWithTarget = NativeSyntheticEvent<{layout: LayoutRectangle; target: HTMLElement}>;

type ScrollingEventData = {
isScrolling: boolean;
};
/**
* A component used to wrap an element intended for displaying a tooltip.
* This tooltip would show immediately without user's interaction and hide after 5 seconds.
Expand Down Expand Up @@ -109,7 +106,7 @@ function BaseEducationalTooltip({children, shouldRender = false, shouldHideOnNav
}

setTooltipPosition(false);
const scrollingListener = DeviceEventEmitter.addListener(CONST.EVENTS.SCROLLING, ({isScrolling}: ScrollingEventData = {isScrolling: false}) => {
const scrollingListener = DeviceEventEmitter.addListener(CONST.EVENTS.SCROLLING, (isScrolling: boolean) => {
setTooltipPosition(isScrolling);
});

Expand Down
4 changes: 1 addition & 3 deletions src/hooks/useScrollEventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const useScrollEventEmitter = () => {

const triggerScrollEvent = useCallback(() => {
const emitScrolling = (isScrolling: boolean) => {
DeviceEventEmitter.emit(CONST.EVENTS.SCROLLING, {
isScrolling,
});
DeviceEventEmitter.emit(CONST.EVENTS.SCROLLING, isScrolling);
};

// Start emitting the scrolling event when the scroll begins
Expand Down
Loading