@colisweb/rescript-toolkit 4.14.14 → 4.14.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  include:
2
- - "https://colisweb-idl.gitlab.io/colisweb-open-source/ci-common/v17.1.1/templates/front.yml"
2
+ - "https://colisweb-idl.gitlab.io/colisweb-open-source/ci-common/v17.7.0/templates/front.yml"
3
3
 
4
4
  variables:
5
5
  GIT_COMMIT_FILES: ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "4.14.14",
3
+ "version": "4.14.16",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -82,9 +82,9 @@ let make = (
82
82
  onClick={event => {
83
83
  switch dropDownRef.current->Js.Nullable.toOption {
84
84
  | None => toggle()
85
- | Some(dropDownRef) => {
86
- let isInDropdown = ReactEvent.Mouse.currentTarget(event)["contains"](. dropDownRef)
87
- if !isInDropdown {
85
+ | Some(_dropDownRef) => {
86
+ let isButton = ReactEvent.Mouse.target(event)["tagName"] === "BUTTON"
87
+ if isButton {
88
88
  toggle()
89
89
  }
90
90
  }
@@ -26,7 +26,12 @@ let make = (
26
26
 
27
27
  Toolkit__Hooks.useOnClickOutside(dropDownRef, _ => {
28
28
  onClickOutside->Option.forEach(fn => fn())
29
- hide()
29
+
30
+ Js.Global.setTimeout(() => {
31
+ if isOpen {
32
+ hide()
33
+ }
34
+ }, 100)->ignore
30
35
  })
31
36
 
32
37
  let (adjustmentStyle, setAdjustmentStyle) = React.useState(() => None)