From 23bdb1f1d2fdb5c52ea132ed2d5ae25c053b52c2 Mon Sep 17 00:00:00 2001 From: Devdeep Ghosh <63492939+thedevildude@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:26:30 +0530 Subject: [PATCH] Fixed pressure sore popup not closing after clicking outside (#6482) * changed PressureSoreInputModal to absolute positioning for handleClickOutside to work * changed PainInputModal to absolute positioning for handleClickOutside to work --- .../Pain/CriticalCare__PainInputModal.res | 25 ++++++++++--------- .../CriticalCare__PressureSoreInputModal.res | 4 +-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res index 63be6d2f3a4..eb4fd2b2376 100644 --- a/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res +++ b/src/Components/CriticalCareRecording/Pain/CriticalCare__PainInputModal.res @@ -31,7 +31,6 @@ let make = ( None }, [state]) - let handleClickOutside = %raw(` function (event, ref, hideModal) { if (ref.current && !ref.current.contains(event.target)) { @@ -56,18 +55,18 @@ let make = ( } }) -let getStatus = (min, minText, max, maxText, val) => { - switch (val >= min, val <= max) { - | (true, true) => ("Normal", "#059669") - | (true, false) => (maxText, "#DC2626") - | _ => (minText, "#DC2626") + let getStatus = (min, minText, max, maxText, val) => { + switch (val >= min, val <= max) { + | (true, true) => ("Normal", "#059669") + | (true, false) => (maxText, "#DC2626") + | _ => (minText, "#DC2626") + } } -}