@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.
@@ -2561,12 +2561,15 @@ function WrappedEntryCard(props) {
2561
2561
  }, "Move to bottom") : null].filter(function (item) {
2562
2562
  return item;
2563
2563
  }) : [],
2564
- onClick: function onClick(e) {
2564
+ onClick: // Providing an onClick handler messes up with some rich text
2565
+ // features e.g. pressing ENTER on a card to add a new paragraph
2566
+ // underneath. It's crucial not to pass a custom handler when
2567
+ // isClickable is disabled which in the case of RT it's.
2568
+ props.isClickable ? function (e) {
2565
2569
  e.preventDefault();
2566
- if (!props.isClickable) return;
2567
2570
  if (props.onClick) return props.onClick(e);
2568
2571
  props.onEdit && props.onEdit();
2569
- }
2572
+ } : undefined
2570
2573
  });
2571
2574
  }
2572
2575
  WrappedEntryCard.defaultProps = defaultProps;
@@ -3097,11 +3100,14 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
3097
3100
  testId: "schedule-icon"
3098
3101
  })),
3099
3102
  src: entityFile && entityFile.url ? size === 'small' ? entityFile.url + "?w=150&h=150&fit=thumb" : entityFile.url + "?h=300" : '',
3100
- onClick: function onClick(e) {
3103
+ onClick: // Providing an onClick handler messes up with some rich text
3104
+ // features e.g. pressing ENTER on a card to add a new paragraph
3105
+ // underneath. It's crucial not to pass a custom handler when
3106
+ // isClickable is disabled which in the case of RT it's.
3107
+ isClickable ? function (e) {
3101
3108
  e.preventDefault();
3102
- if (!isClickable) return;
3103
3109
  onEdit && onEdit();
3104
- },
3110
+ } : undefined,
3105
3111
  dragHandleRender: props.renderDragHandle,
3106
3112
  withDragHandle: !!props.renderDragHandle,
3107
3113
  actions: [].concat(renderActions({