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

InputRightElement is outside of input if there are 2+ elements inside #8362

Open
1 of 3 tasks
FreePhoenix888 opened this issue Mar 15, 2024 · 1 comment
Open
1 of 3 tasks

Comments

@FreePhoenix888
Copy link

FreePhoenix888 commented Mar 15, 2024

Description

When I put 2 elements in RightInputElement the right elements goes outside of the input
I expect to have two elements at the right side of my input but the right elements is going outside of the input

Link to Reproduction

https://codesandbox.io/p/sandbox/elastic-montalcini-p4y87f

Steps to reproduce

  1. Open Link to Reproduction and see

Chakra UI Version

2.8.2

Browser

Google Chrome Version 121.0.6167.160 (Official Build) (64-bit)

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

If I put elements in HStack nothing is changed. There is a question and answer about this problem: https://stackoverflow.com/a/75120814/13545849 but it suggets to set marginRight manually, I think it is just a workaround, not a solution. Material ui lets to do such things, it would be good if chakra would have ability to do this too

@mhamid3d
Copy link

mhamid3d commented Apr 14, 2024

The default width for input elements are equal to the height of the input. You have to manually change the width. For example use double the height of the input as the width:

<InputRightElement width="calc(var(--input-height) * 2)">

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

2 participants