@atlaskit/react-select 1.0.3 → 1.0.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/react-select
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#150410](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150410)
8
+ [`010ae8c2986e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/010ae8c2986e6) -
9
+ If select is within react-beatiful-dnd, don't prevent onMouseDown event to fix select is not
10
+ clickable in dnd
11
+
3
12
  ## 1.0.3
4
13
 
5
14
  ### Patch Changes
@@ -453,7 +453,12 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
453
453
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onControlMouseDown", function (event) {
454
454
  // Event captured by dropdown indicator
455
455
  if (event.defaultPrevented) {
456
- return;
456
+ var _this$controlRef;
457
+ // react-dnd will fire preventDefault in mouseDown, which make select is not clickable.
458
+ // temp workaround to check if select is within dnd, we don't do the early return.
459
+ if (!((_this$controlRef = _this.controlRef) !== null && _this$controlRef !== void 0 && _this$controlRef.closest('[data-rbd-draggable-context-id]'))) {
460
+ return;
461
+ }
457
462
  }
458
463
  var openMenuOnClick = _this.props.openMenuOnClick;
459
464
  if (!_this.state.isFocused) {
@@ -419,7 +419,12 @@ export default class Select extends Component {
419
419
  _defineProperty(this, "onControlMouseDown", event => {
420
420
  // Event captured by dropdown indicator
421
421
  if (event.defaultPrevented) {
422
- return;
422
+ var _this$controlRef;
423
+ // react-dnd will fire preventDefault in mouseDown, which make select is not clickable.
424
+ // temp workaround to check if select is within dnd, we don't do the early return.
425
+ if (!((_this$controlRef = this.controlRef) !== null && _this$controlRef !== void 0 && _this$controlRef.closest('[data-rbd-draggable-context-id]'))) {
426
+ return;
427
+ }
423
428
  }
424
429
  const {
425
430
  openMenuOnClick
@@ -443,7 +443,12 @@ var Select = /*#__PURE__*/function (_Component) {
443
443
  _defineProperty(_assertThisInitialized(_this), "onControlMouseDown", function (event) {
444
444
  // Event captured by dropdown indicator
445
445
  if (event.defaultPrevented) {
446
- return;
446
+ var _this$controlRef;
447
+ // react-dnd will fire preventDefault in mouseDown, which make select is not clickable.
448
+ // temp workaround to check if select is within dnd, we don't do the early return.
449
+ if (!((_this$controlRef = _this.controlRef) !== null && _this$controlRef !== void 0 && _this$controlRef.closest('[data-rbd-draggable-context-id]'))) {
450
+ return;
451
+ }
447
452
  }
448
453
  var openMenuOnClick = _this.props.openMenuOnClick;
449
454
  if (!_this.state.isFocused) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-select",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A forked version of react-select to only be used in atlaskit/select",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",