diff --git a/packages/esm-patient-chart-app/src/patient-chart/action-menu/action-menu.component.tsx b/packages/esm-patient-chart-app/src/patient-chart/action-menu/action-menu.component.tsx index 6ee90261d1..62c3cf2715 100644 --- a/packages/esm-patient-chart-app/src/patient-chart/action-menu/action-menu.component.tsx +++ b/packages/esm-patient-chart-app/src/patient-chart/action-menu/action-menu.component.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; -import { ExtensionSlot } from '@openmrs/esm-framework'; +import { ExtensionSlot, useLayoutType } from '@openmrs/esm-framework'; import styles from './action-menu.scss'; interface ActionMenuInterface { @@ -10,7 +10,7 @@ interface ActionMenuInterface { export const ActionMenu: React.FC = ({ open }) => { const [keyboardVisible, setKeyboardVisible] = useState(false); const initialHeight = useRef(window.innerHeight); - + const isTablet = useLayoutType() === 'tablet'; useEffect(() => { const handleKeyboardVisibilityChange = () => { setKeyboardVisible(initialHeight.current > window.innerHeight); @@ -22,6 +22,10 @@ export const ActionMenu: React.FC = ({ open }) => { return () => window.removeEventListener('resize', handleKeyboardVisibilityChange); }, [initialHeight]); + if (open && isTablet) { + return null; + } + return (