Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add draggable prop to <Text /> #2655

Open
1 task done
AlirezaHadjar opened this issue Apr 5, 2024 · 0 comments
Open
1 task done

Add draggable prop to <Text /> #2655

AlirezaHadjar opened this issue Apr 5, 2024 · 0 comments
Labels
enhancement Requires extension or creation of new React Native API

Comments

@AlirezaHadjar
Copy link

AlirezaHadjar commented Apr 5, 2024

Is there an existing request?

  • I have searched for this request

Describe the feature request

Hi,

I'm trying to make a draggable text component, and as I looked at the source code, draggable prop which is supported by p, div, and span is not handled in the /react-native-web/src/exports/Text/index.js

in this file there's a list of accepted props:

const forwardPropsList = Object.assign(
  {},
  forwardedProps.defaultProps,
  forwardedProps.accessibilityProps,
  forwardedProps.clickProps,
  forwardedProps.focusProps,
  forwardedProps.keyboardProps,
  forwardedProps.mouseProps,
  forwardedProps.touchProps,
  forwardedProps.styleProps,
  {
    href: true,
    lang: true,
    pointerEvents: true
  }
);

I have tested it and adding it to the list fixes the issue.

const forwardPropsList = Object.assign(
  {},
  forwardedProps.defaultProps,
  forwardedProps.accessibilityProps,
  forwardedProps.clickProps,
  forwardedProps.focusProps,
  forwardedProps.keyboardProps,
  forwardedProps.mouseProps,
  forwardedProps.touchProps,
  forwardedProps.styleProps,
  {
    href: true,
    lang: true,
    pointerEvents: true,
    draggable: true
  }
);

Is it possible to add draggable to this list as well? or if this is not possible could you please guide me on how to fix this without using patch-package? I'm adding drag/drop text support to my package and asking every user to use patch package is not ideal

PS: I have already tried dataSet prop and setNativeProps but none of them works here.

@AlirezaHadjar AlirezaHadjar added the enhancement Requires extension or creation of new React Native API label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requires extension or creation of new React Native API
Projects
None yet
Development

No branches or pull requests

1 participant