-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
TextArea incorrect height with autoHeight prop when element is not visible #1405
Comments
import React from 'react'
import { Grid, Header, Form } from 'semantic-ui-react'
const TextAreaExampleAutoHeight = () => (
<Grid>
<Grid.Row columns={2}>
<Grid.Column>
<Header size="small">General Conditions</Header>
<Form>
<Form.TextArea label="Textarea 1" defaultValue="Lorem Ipsum" disabled readOnly autoHeight />
</Form>
</Grid.Column>
<Grid.Column>
<Header size="small">Special Conditions</Header>
<Form>
<Form.TextArea label=" " defaultValue="Lorem Ipsum" disabled readOnly autoHeight />
</Form>
</Grid.Column>
</Grid.Row>
<Grid.Row columns={2}>
<Grid.Column>
<Form>
<Form.TextArea label="Textarea 2" defaultValue="Lorem Ipsum" disabled readOnly autoHeight />
</Form>
</Grid.Column>
<Grid.Column>
<Form>
<Form.TextArea label=" " defaultValue="Lorem Ipsum" disabled readOnly autoHeight />
</Form>
</Grid.Column>
</Grid.Row>
<Grid.Row columns={2}>
<Grid.Column>
<Form>
<Form.TextArea label="Textarea 3" defaultValue="Lorem Ipsum" disabled readOnly autoHeight />
</Form>
</Grid.Column>
<Grid.Column>
<Form>
<Form.TextArea label=" " defaultValue="Lorem Ipsum" disabled readOnly autoHeight />
</Form>
</Grid.Column>
</Grid.Row>
</Grid>
)
export default TextAreaExampleAutoHeight |
@levithomason I know that the TextArea must be under a To prove you wrong, this is how it looks if it's not placed under a parent with the Also, for who ever is interested, is redundant to place a
Anyway, as stated at the start of the issue, the update I did:
The key word is However, @levithomason given your answer and that you've closed this thread, should I open a new one once I've got the demo going? |
Issues are very easy to re-open :) If we can get a repro of this issue we will certainly re-open it. Currently, all we have are working docs and passing tests for this feature. |
Version: 0.67.1 I was able to reproduce the problem with AutoHeight when trying to render a Form.TextArea component inside an Accordion. import React from 'react'
import { Form, Accordion, Label, Message } from 'semantic-ui-react'
import faker from 'faker'
import _ from 'lodash'
const panels = _.times(3, i => ({
key: `panel-${i}`,
title: <Label color='blue' content={faker.lorem.sentence()} />,
content: (
<Form>
<Form.TextArea placeholder='Try adding multiple lines' autoHeight />
</Form>
),
}))
const AccordionExamplePanelsPropWithCustomTitleAndContent = () => (
<Accordion panels={panels} />
)
export default AccordionExamplePanelsPropWithCustomTitleAndContent When I start typing inside the text area, it will immediately resize to the correct height. |
@edchiou you are the man, it's a perfect example. I've literally forgotten to come back and update the issue, even though I've previously said this:
From my findings, the reason why this is happening is because of @edchiou the way I've managed to overpass the issue, was to leverage |
Any news on this? I'm encountering the same issue with a TextArea found inside a tab. |
@mihai-dinculescu the way I've handled this issue was to have the not-active tab render with |
Fixed in #1793. Thanks for the reporting. |
Update
Managed to find out exactly why this issue happens. Will come back and edit this with and jsfiddle that replicates exactly this issue. Spoiler, it has to do with setting tabular items.
I am getting this weird issue when using
Form.TextArea
withautoHeight
anddisabled
props. The height of the textarea is not set correctly as you can see in the SS below:Here is the JSX:
Under inspect element, the style properties for the TextArea are being set as:
Where the
height: 2px
is obviously wrong.Version
0.67.0
The text was updated successfully, but these errors were encountered: