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

Android content not respecting right margin when trigger is right aligned #43

Closed
Estevete opened this issue Apr 26, 2023 · 4 comments
Closed

Comments

@Estevete
Copy link

Estevete commented Apr 26, 2023

When aligning the trigger to the right, the content gets opened without leaving a margin right on Android.

Code:

    <View style={{ position: "absolute", right: 0 }}>
      <DropdownMenuRoot>
        <DropdownMenuTrigger>
            <FontAwesomeIcon
              icon={faEllipsisVertical}
              color={colors.primary}
              style={{
                marginRight: 10
              }}
              size={iconSizes.xl} />
        </DropdownMenuTrigger>

        <DropdownMenuContent>
          <DropdownMenu.Sub>
            <DropdownMenu.SubTrigger
              key="language"
              textValue="Language">
            </DropdownMenu.SubTrigger>

            <DropdownMenu.SubContent>
               ....
            </DropdownMenu.SubContent>
          </DropdownMenu.Sub>

          <DropdownMenuItem
            key="help"
            textValue="Help">
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenuRoot>
    </View>

Current behavior
On the image, the content has no "native" margin right. On iOS, it does.
image

Expected behavior
Other native apps (like contacts) do have margin right when trigger is right aligned
image

** If it is left aligned, it has left margin.

@nandorojo
Copy link
Owner

can you see if react native menu has support for a solution? that’s what we use under the hood for android

@nandorojo
Copy link
Owner

also, wait, is your trigger using margin or padding on the right side? i think it’s a problem with your code. the second screenshot aligns itself to the right of the search input, whereas your button might touch the right end of the screen.

@Estevete
Copy link
Author

I already have a margin. Eventhough I increse it to have like 100 marginRight, it's still sticked on the right side on Android.

Android:

image

iOS:
image

It only leaves the margin when the trigger is almost centered:
image

@Code-Victor
Copy link

I'm experiencing the same issue too

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

3 participants