UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

14 lines 746 B
/* https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx#L1 */ /** * Utility to consistently call original eventhandler, often from props and internal eventhandler * @internal */ export function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) { return function handleEvent(event) { originalEventHandler === null || originalEventHandler === void 0 ? void 0 : originalEventHandler(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) { return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); } }; } //# sourceMappingURL=composeEventHandlers.js.map