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

Change borderRadius in ContextMenu.Preview #56

Open
tanlucvo opened this issue Aug 26, 2023 · 9 comments
Open

Change borderRadius in ContextMenu.Preview #56

tanlucvo opened this issue Aug 26, 2023 · 9 comments

Comments

@tanlucvo
Copy link

I use borderRadius but it not work

Screen.Recording.2023-08-26.at.21.03.52.mov
@tanlucvo
Copy link
Author

<View style={{ width: 80, height: 80, borderRadius: 40 }}>
  <DropdownMenu.Root style={{ width: 80, height: 80, borderRadius: 40 }}>
    <DropdownMenu.Trigger action="press">
      <Image source={{uri:"https://picsum.photos/400/400"}} style={{ width: 80, height: 80, borderRadius: 40 }} />
    </DropdownMenu.Trigger>
    <DropdownMenu.Content style={{ borderRadius: 100 }}>
      <DropdownMenu.Preview>
        <Image source={{uri:"https://picsum.photos/400/400"}}  style={{ width: 200, height: 200, borderRadius: 100 }} />
      </DropdownMenu.Preview>
    </DropdownMenu.Content>
  </DropdownMenu.Root>
</View>

@nandorojo
Copy link
Owner

border radius needs to get passed as a prop to the preview

@tanlucvo
Copy link
Author

tanlucvo commented Aug 26, 2023

I try use prop borderRadius in preview, It seems not work

Screen.Recording.2023-08-26.at.21.34.45.mov
<DropdownMenu.Root style={{ width: 80, height: 80, borderRadius: 40 }}>
  <DropdownMenu.Trigger>
    <AsyncImage uri={'https://picsum.photos/400/400'} style={{ width: 80, height: 80, borderRadius: 40 }} />
  </DropdownMenu.Trigger>
  <DropdownMenu.Content>
    <DropdownMenu.Preview borderRadius={100} backgroundColor="#ff0000">
      <AsyncImage uri={'https://picsum.photos/400/400'} style={{ width: 200, height: 200, borderRadius: 100 }} />
    </DropdownMenu.Preview>
  </DropdownMenu.Content>
</DropdownMenu.Root>

@nandorojo
Copy link
Owner

might be a bug of the upstream ios library. but also, your usage of preview looks wrong. it receives a function as a child

@nandorojo
Copy link
Owner

for the record, you only need to use the preview if it has a different view than the trigger. if it’s the same view, you can leave the preview out

@mikescott
Copy link

I'm having the same issue.

Expo SDK: 49

React Native: 0.72.1

iOS: 15 and 16

borderRadius has no effect on ContextMenu.Preview

@nandorojo
Copy link
Owner

interesting, i’m thinking it’s an issue with the upstream library. does setting it to 0 work? i wonder if there’s a max or not

@ushan-swivel
Copy link

anyone found a solution?

@nandorojo
Copy link
Owner

Can you open an issue on the upstream iOS library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants