dtable-ui-component 7.0.5-pal.18 → 7.0.5-pal.19

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.
@@ -45,6 +45,13 @@ class DTableCustomizeSelect extends _react.Component {
45
45
  isShowSelectOptions: false
46
46
  });
47
47
  };
48
+ this.handleDocumentMouseDown = event => {
49
+ if (!this.state.isShowSelectOptions) return;
50
+ const target = event.target;
51
+ if (this.selector && this.selector.contains(target)) return;
52
+ if (target && target.closest && target.closest('.seatable-option-group')) return;
53
+ this.closeSelect();
54
+ };
48
55
  this.getSelectedOptionTop = () => {
49
56
  if (!this.selector) return 38;
50
57
  const _this$selector$getBou = this.selector.getBoundingClientRect(),
@@ -80,6 +87,12 @@ class DTableCustomizeSelect extends _react.Component {
80
87
  isShowSelectOptions: false
81
88
  };
82
89
  }
90
+ componentDidMount() {
91
+ document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
92
+ }
93
+ componentWillUnmount() {
94
+ document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
95
+ }
83
96
  render() {
84
97
  let _this$props2 = this.props,
85
98
  className = _this$props2.className,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "7.0.5pal.18",
3
+ "version": "7.0.5pal.19",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",