mrzachnugent / react-native-reusables

Universal shadcn/ui for React Native featuring a focused collection of components - Crafted with NativeWind v4 and accessibility in mind.
https://rnr-docs.vercel.app
MIT License
3.75k stars 155 forks source link

[ BUG ] Textarea and Input can't work properly with Dialog #248

Open hlf2016 opened 1 month ago

hlf2016 commented 1 month ago

Describe the bug When there is a Input on the Dialog ,the words in the input will over flow the container IMG_CA39295D710B-1

While there is a Textarea on the Dialog ,the words are gonna be flashing like crazy inside the container [

https://github.com/user-attachments/assets/74c170d7-9dc4-4bf0-af2a-a7509258a4d4

](url)

To Reproduce Input

<Dialog>
                        <DialogTrigger asChild>
                            <Button variant='ghost'>
                                <Plus className='text-primary' />
                            </Button>
                        </DialogTrigger>
                        <DialogContent className='sm:max-w-[425px]'>
                            <DialogHeader>
                                <DialogTitle>订阅地址</DialogTitle>
                            </DialogHeader>
                            <Input
                                className='w-[85vw]'
                                placeholder='写入订阅源网址,以 http 或 https 开头'
                                value={subscribeUrl}
                                onChangeText={setSubscribeUrl}
                                numberOfLines={1}
                            />
                            <DialogFooter className='mt-3'>
                                <DialogClose asChild>
                                    <Button>
                                        <Text>导入</Text>
                                    </Button>
                                </DialogClose>
                            </DialogFooter>
                        </DialogContent>
                    </Dialog>

Textarea

<Dialog>
                        <DialogTrigger asChild>
                            <Button variant='ghost'>
                                <Plus className='text-primary' />
                            </Button>
                        </DialogTrigger>
                        <DialogContent className='sm:max-w-[425px]'>
                            <DialogHeader>
                                <DialogTitle>订阅地址</DialogTitle>
                            </DialogHeader>
                            <Textarea
                                className='w-[85vw]'
                                placeholder='写入订阅源网址,以 http 或 https 开头'
                                value={subscribeUrl}
                                onChangeText={setSubscribeUrl}
                                numberOfLines={1}
                            />
                            <DialogFooter className='mt-3'>
                                <DialogClose asChild>
                                    <Button>
                                        <Text>导入</Text>
                                    </Button>
                                </DialogClose>
                            </DialogFooter>
                        </DialogContent>
                    </Dialog>

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

Additional context Add any other context about the problem here.

mrzachnugent commented 1 month ago

Hey @hlf2016

The Textarea bug seems to be a React-Native bug with the multiline prop. (see: https://github.com/facebook/react-native/issues/46850)

For the TextInput, you can remove the native:leading-[1.25] class name.