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

Unnable to set TextField's textAlign in Joy UI #35142

Closed
bexoss opened this issue Nov 14, 2022 · 2 comments
Closed

Unnable to set TextField's textAlign in Joy UI #35142

bexoss opened this issue Nov 14, 2022 · 2 comments
Labels
component: text field This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy support: question Community support but can be turned into an improvement

Comments

@bexoss
Copy link

bexoss commented Nov 14, 2022

How do I set textAlign with Joy UI TextField?
Nothings gonna make it properly with inputProps.

import TextField from '@mui/joy/TextField'

... 


 <TextField
    inputProps={{ style: { textAlign: 'right' } }}
    InputProps={{
        inputProps: {
            style: { textAlign: 'right' },
        },
    }} 
 />
@zannager zannager added component: text field This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 14, 2022
@siriwatknp siriwatknp added package: joy-ui Specific to @mui/joy and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 15, 2022
@siriwatknp
Copy link
Member

siriwatknp commented Nov 15, 2022

@bexoss I recommend that you use Input + FormControl instead. We are considering getting rid of the TextField component.

<Input sx={{ '& input': { textAlign: 'right' } }} />

Sandbox: https://codesandbox.io/s/condescending-sanne-8nd3nb?file=/demo.tsx

@siriwatknp siriwatknp added the support: question Community support but can be turned into an improvement label Nov 15, 2022
@bexoss
Copy link
Author

bexoss commented Nov 17, 2022

@siriwatknp THANKS A LOT!+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants