ui-kit-ck-consultant 0.5.301 → 0.5.302

Sign up to get free protection for your applications and to get access to all the features.
@@ -706,19 +706,39 @@ var FormSelectMultiples = /*#__PURE__*/function (_React$Component) {
706
706
  }
707
707
  };
708
708
 
709
+ _this.detectClickOutside = function () {
710
+ window.addEventListener('mousedown', function (event) {
711
+ if (!_this.containerRef.current.contains(event.target)) {
712
+ _this.setState({
713
+ isDisplay: false
714
+ });
715
+ }
716
+ });
717
+ };
718
+
709
719
  _this.state = {
710
720
  isDisplay: false
711
721
  };
722
+ _this.containerRef = React.createRef();
712
723
  _this.inputRef = React.createRef();
713
724
  return _this;
714
725
  }
715
726
 
716
727
  var _proto = FormSelectMultiples.prototype;
717
728
 
729
+ _proto.componentDidMount = function componentDidMount() {
730
+ document.addEventListener('mousedown', this.detectClickOutside);
731
+ };
732
+
733
+ _proto.componentWillUnmount = function componentWillUnmount() {
734
+ window.removeEventListener('mousedown', this.detectClickOutside);
735
+ };
736
+
718
737
  _proto.render = function render() {
719
738
  var _this2 = this;
720
739
 
721
740
  return /*#__PURE__*/React.createElement("div", {
741
+ ref: this.containerRef,
722
742
  className: classNames$1(style$6.form_select_multiples_container, this.props.className)
723
743
  }, this.props.title ? /*#__PURE__*/React.createElement("span", {
724
744
  className: this.props.classNameTitle