dominicstop / react-native-ios-context-menu

A react-native component to use context menu's (UIMenu) on iOS 13/14+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

with AuxiliaryPreview, verylong text make the action not show full

fukemy opened this issue · comments

Hi, with verylong of text, the action does not display full, like below picture:
Screen Shot 2022-08-08 at 17 30 17

Can u take a look

here is the video test with real device, for more information:
video

Hi, unfortunately I do not have the time to tackle this issue at the moment, but there are workarounds you can employ in order to get around this bug ✨

Workaround A: Negative Margins

If you know that the context menu preview will be very big, then assign a negative value marginPreview so that the aux. preview appears inside of the context menu preview.

auxiliaryPreviewConfig={{
  transitionEntranceDelay: 'RECOMMENDED',
  marginPreview: -100,
}}

Simulator Screen Shot - iPhone 8 - 2022-08-11 at 18 27 25

Workaround B: Custom Preview

If you know that the context menu preview will be very big, then use a custom preview for it with a "truncated" version of the thing you want to show in the preview.

<ContextMenuView
  menuConfig={{
    menuTitle: 'ContextMenuAuxPreviewTest02',
  }}
  previewConfig={{
    previewType: isComponentBig ? 'CUSTOM' : 'DEFAULT'
  }}
  renderPreview={() => {
    return (
      <ComponentToShow shouldTruncate={true}/>
    );
  }}
>
  <ComponentToShow shouldTruncate={false}/>
</ContextMenuView>

hope this helps, xx

nice solution, thank u