playbook_ui 12.26.1.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown831 → 12.26.1.pre.alpha.play716popoverkitcloseonclickissue833

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -26
  3. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +95 -102
  4. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -18
  5. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +4 -15
  6. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +1 -84
  7. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +4 -38
  8. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -4
  9. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -3
  10. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +2 -3
  11. data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
  12. data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +1 -1
  13. data/app/pb_kits/playbook/pb_popover/_popover.tsx +5 -3
  14. data/app/pb_kits/playbook/pb_popover/index.ts +5 -2
  15. data/dist/playbook-rails.js +7 -279
  16. data/lib/playbook/version.rb +1 -1
  17. metadata +2 -11
  18. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.html.erb +0 -12
  19. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +0 -3
  20. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.html.erb +0 -12
  21. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.jsx +0 -18
  22. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +0 -1
  23. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.jsx +0 -17
  24. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +0 -1
  25. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +0 -168
  26. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_quick_pick_styles.scss +0 -75
@@ -171,17 +171,19 @@ 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 || targetIsReference) {
179
+ if (targetIsPopover) {
180
180
  shouldClosePopover(true);
181
181
  }
182
182
  break;
183
183
  case "any":
184
- shouldClosePopover(true);
184
+ if (targetIsPopover || !targetIsPopover && !targetIsReference) {
185
+ shouldClosePopover(true);
186
+ }
185
187
  break;
186
188
  }
187
189
  },
@@ -49,13 +49,16 @@ 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
52
53
 
53
54
  switch (this.closeOnClick) {
54
55
  case 'any':
55
- this.hideTooltip()
56
+ if (isTooltipElement || !isTooltipElement && !isTriggerElement) {
57
+ this.hideTooltip()
58
+ }
56
59
  break
57
60
  case 'outside':
58
- if (!isTooltipElement) {
61
+ if (!isTooltipElement && !isTriggerElement) {
59
62
  this.hideTooltip()
60
63
  }
61
64
  break