@contentful/field-editor-reference 4.3.7 → 4.3.8

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
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.3.8](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.7...@contentful/field-editor-reference@4.3.8) (2022-06-15)
7
+
8
+ ### Bug Fixes
9
+
10
+ - don't register onClick callbacks when isClickable is false ([#1163](https://github.com/contentful/field-editors/issues/1163)) ([fe6fc6b](https://github.com/contentful/field-editors/commit/fe6fc6b872acfde3b097c626d2eef81a7cc24193))
11
+
6
12
  ## [4.3.7](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.6...@contentful/field-editor-reference@4.3.7) (2022-06-07)
7
13
 
8
14
  ### Bug Fixes
@@ -2568,12 +2568,15 @@ function WrappedEntryCard(props) {
2568
2568
  }, "Move to bottom") : null].filter(function (item) {
2569
2569
  return item;
2570
2570
  }) : [],
2571
- onClick: function onClick(e) {
2571
+ onClick: // Providing an onClick handler messes up with some rich text
2572
+ // features e.g. pressing ENTER on a card to add a new paragraph
2573
+ // underneath. It's crucial not to pass a custom handler when
2574
+ // isClickable is disabled which in the case of RT it's.
2575
+ props.isClickable ? function (e) {
2572
2576
  e.preventDefault();
2573
- if (!props.isClickable) return;
2574
2577
  if (props.onClick) return props.onClick(e);
2575
2578
  props.onEdit && props.onEdit();
2576
- }
2579
+ } : undefined
2577
2580
  });
2578
2581
  }
2579
2582
  WrappedEntryCard.defaultProps = defaultProps;
@@ -3104,11 +3107,14 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
3104
3107
  testId: "schedule-icon"
3105
3108
  })),
3106
3109
  src: entityFile && entityFile.url ? size === 'small' ? entityFile.url + "?w=150&h=150&fit=thumb" : entityFile.url + "?h=300" : '',
3107
- onClick: function onClick(e) {
3110
+ onClick: // Providing an onClick handler messes up with some rich text
3111
+ // features e.g. pressing ENTER on a card to add a new paragraph
3112
+ // underneath. It's crucial not to pass a custom handler when
3113
+ // isClickable is disabled which in the case of RT it's.
3114
+ isClickable ? function (e) {
3108
3115
  e.preventDefault();
3109
- if (!isClickable) return;
3110
3116
  onEdit && onEdit();
3111
- },
3117
+ } : undefined,
3112
3118
  dragHandleRender: props.renderDragHandle,
3113
3119
  withDragHandle: !!props.renderDragHandle,
3114
3120
  actions: [].concat(renderActions({