@eturnity/eturnity_reusable_components 9.19.2 → 9.19.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "9.19.2",
3
+ "version": "9.19.3",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -509,6 +509,9 @@
509
509
  Bottom: 'bottom',
510
510
  }
511
511
 
512
+ /** Capture phase so this runs before @click.stop on the caret (EPDM-18900). */
513
+ const CLICK_OUTSIDE_CAPTURE = true
514
+
512
515
  export default {
513
516
  name: 'RCselect',
514
517
 
@@ -885,7 +888,11 @@
885
888
  },
886
889
  beforeMount() {
887
890
  this.selectedValue = this.value
888
- document.addEventListener('click', this.clickOutside)
891
+ document.addEventListener(
892
+ 'click',
893
+ this.clickOutside,
894
+ CLICK_OUTSIDE_CAPTURE
895
+ )
889
896
  this.getDropdownPosition()
890
897
  window.removeEventListener('resize', this.handleSetDropdownOffet)
891
898
  if (this.dropdownResizeObserver) this.dropdownResizeObserver.disconnect()
@@ -898,7 +905,11 @@
898
905
  }
899
906
  },
900
907
  unmounted() {
901
- document.removeEventListener('click', this.clickOutside)
908
+ document.removeEventListener(
909
+ 'click',
910
+ this.clickOutside,
911
+ CLICK_OUTSIDE_CAPTURE
912
+ )
902
913
  },
903
914
  methods: {
904
915
  getDropdownTopScrollYOffset() {
@@ -983,6 +994,7 @@
983
994
  clickOutside(event) {
984
995
  const dropdownRef = this.$refs.dropdown
985
996
  if (!this.isClickOutsideActive) return
997
+ if (!this.$refs.select?.$el || !dropdownRef?.$el) return
986
998
  if (
987
999
  this.$refs.select.$el == event.target ||
988
1000
  this.$refs.select.$el.contains(event.target) ||
@@ -213,6 +213,9 @@
213
213
  import InfoText from '../infoText'
214
214
  import MainButton from '../buttons/mainButton'
215
215
 
216
+ /** Capture phase so this runs before @click.stop on arrows (EPDM-18900). */
217
+ const CLICK_OUTSIDE_CAPTURE = true
218
+
216
219
  const rowAttrs = { disabled: Boolean, isOpen: Boolean }
217
220
  const DropdownRow = styled('div', rowAttrs)`
218
221
  cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
@@ -577,7 +580,11 @@
577
580
  watch: {
578
581
  isOpen(newVal) {
579
582
  if (newVal) {
580
- document.addEventListener('click', this.clickOutside)
583
+ document.addEventListener(
584
+ 'click',
585
+ this.clickOutside,
586
+ CLICK_OUTSIDE_CAPTURE
587
+ )
581
588
  this.$emit('dropdown-search', '')
582
589
  this.$nextTick(() => {
583
590
  this.$refs.searchInput.$el.children[0].children[0].focus()
@@ -619,7 +626,11 @@
619
626
  }
620
627
  this.wasClicked = false
621
628
  if (!this.isOpen) {
622
- document.addEventListener('click', this.clickOutside)
629
+ document.addEventListener(
630
+ 'click',
631
+ this.clickOutside,
632
+ CLICK_OUTSIDE_CAPTURE
633
+ )
623
634
  this.$emit('dropdown-search', '')
624
635
  this.$nextTick(() => {
625
636
  this.scrollToItem()
@@ -629,7 +640,11 @@
629
640
  this.$refs.searchInput.$el.children[0].children[1].focus()
630
641
  })
631
642
  } else {
632
- document.removeEventListener('click', this.clickOutside)
643
+ document.removeEventListener(
644
+ 'click',
645
+ this.clickOutside,
646
+ CLICK_OUTSIDE_CAPTURE
647
+ )
633
648
  this.$emit('toggle-dropdown-open', { close: true })
634
649
  this.inputText = ''
635
650
  }
@@ -668,7 +683,11 @@
668
683
  this.inputText = ''
669
684
  // 'close: true' is needed in case a box is open and another box is clicked on
670
685
  // so this one will close properly
671
- document.removeEventListener('click', this.clickOutside)
686
+ document.removeEventListener(
687
+ 'click',
688
+ this.clickOutside,
689
+ CLICK_OUTSIDE_CAPTURE
690
+ )
672
691
  this.$emit('toggle-dropdown-open', { close: true })
673
692
  },
674
693
  onCustomNameClick() {