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

fix: add support for changing the surface mode in the menu #4378

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lenzi-erickson
Copy link

Motivation

I prefer the "flat" design approach on my components, and would like to be able to use the Menu component in flat mode.

Related issue

You cannot currently change the mode on the Surface that is used in the Menu component.

Test plan

Pull up the menu example and pass mode="flat" to one of the menus to test.

@callstack-bot
Copy link

callstack-bot commented Apr 21, 2024

Hey @lenzi-erickson, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@seb-zabielski
Copy link

Hey,
Modal component has an “elevation” property. If you set elevation={0} it should look like a flat component. Does your change have a better/different effect than the elevation prop?
https://callstack.github.io/react-native-paper/docs/components/Menu/#elevation

@lenzi-erickson
Copy link
Author

Hey, Modal component has an “elevation” property. If you set elevation={0} it should look like a flat component. Does your change have a better/different effect than the elevation prop? https://callstack.github.io/react-native-paper/docs/components/Menu/#elevation

elevation={0} does not do what I was wanting. In my opinion, it makes the menu look broken. If you run the example in this branch, you can see the differences.

Default
Screenshot 2024-06-19 at 2 23 44 PM

elevation={0}
Screenshot 2024-06-19 at 2 25 46 PM

mode="flat"
Screenshot 2024-06-19 at 2 27 07 PM

@gedu gedu added this to the 5.12.4 milestone Jun 20, 2024
@seb-zabielski
Copy link

Now I see your point. Change looks good to me. Can you add a test to this case?

@lenzi-erickson
Copy link
Author

Now I see your point. Change looks good to me. Can you add a test to this case?

What are you wanting me to test, exactly? Since I'm just passing a prop through, and did not add any logic, I'm not sure what you are wanting me to test.

@lenzi-erickson
Copy link
Author

I attempted to add some tests. If it's not what you are hoping for, I need some help getting it here, please.

@seb-zabielski
Copy link

This is exactly what I was expecting. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants