playbook_ui 12.29.0.pre.alpha.play716popoverkitcloseonclickissue893 → 12.29.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15f7ff554db86a7218c690ce296e7aeff840ebc5272b964807f8ea89da3841b8
4
- data.tar.gz: fdb097512bdebc712087f5a852aa1edd4ff901ab6a32c2896a28acf013db087f
3
+ metadata.gz: 8d6b07b61b7b29b66f8649816faa1c0cf9f658df0f80ca5c580541f384efe3e3
4
+ data.tar.gz: af3e2140059844f20d5289e2d56ba87d26c0df0fc2061a271648a2b26d913171
5
5
  SHA512:
6
- metadata.gz: 703a84e571f96f23c843b702bf30f9ddb9a4300dd2d3de88573f1530d16992d3531c9a4cc799c9723f93808f0c5dff4450668c74eef560d5f2d83eba55418eb7
7
- data.tar.gz: c8cffa2d650853fb72982270243a7812eeb2d9c1b6627a5e2c2255c036e27ca9edfab64e2ebca2cd824ec264c23edcb14cb0c4d2e0ca2eee11923fe76d395f3c
6
+ metadata.gz: e3154d4f0a1cbc50826fc27e321bb09debfa07735a91b31fe9c99a459b979585a349242bc2f88e12e3d149d8c87c378e1a99faa6872969af257f84df7c1ad1fc
7
+ data.tar.gz: 5f8e5f58faaaaac3bdc5a97f09cbe21765f2159918d5047825589dbac05a7c71d7321874867d64963c71910f343a93b7298a38af00dcab42e4e50e09e918525e
@@ -171,19 +171,17 @@ const PbReactPopover = (props: PbPopoverProps) => {
171
171
 
172
172
  switch (closeOnClick) {
173
173
  case "outside":
174
- if (!targetIsPopover && !targetIsReference) {
174
+ if (!targetIsPopover || targetIsReference) {
175
175
  shouldClosePopover(true);
176
176
  }
177
177
  break;
178
178
  case "inside":
179
- if (targetIsPopover) {
179
+ if (targetIsPopover || targetIsReference) {
180
180
  shouldClosePopover(true);
181
181
  }
182
182
  break;
183
183
  case "any":
184
- if (targetIsPopover || !targetIsPopover && !targetIsReference) {
185
- shouldClosePopover(true);
186
- }
184
+ shouldClosePopover(true);
187
185
  break;
188
186
  }
189
187
  },
@@ -49,16 +49,13 @@ export default class PbPopover extends PbEnhancedElement {
49
49
  checkCloseTooltip() {
50
50
  document.querySelector('body').addEventListener('click', ({ target } ) => {
51
51
  const isTooltipElement = (target as HTMLElement).closest(`#${this.tooltipId}`) !== null
52
- const isTriggerElement = (target as HTMLElement).closest(`#${this.triggerElementId}`) !== null
53
52
 
54
53
  switch (this.closeOnClick) {
55
54
  case 'any':
56
- if (isTooltipElement || !isTooltipElement && !isTriggerElement) {
57
- this.hideTooltip()
58
- }
55
+ this.hideTooltip()
59
56
  break
60
57
  case 'outside':
61
- if (!isTooltipElement && !isTriggerElement) {
58
+ if (!isTooltipElement) {
62
59
  this.hideTooltip()
63
60
  }
64
61
  break