instructure / instructure-ui

A UI Component Library made by Instructure, Inc.
https://instructure.design/
Other
443 stars 100 forks source link

Fix/textarea highlight sizing #1422

Closed balzss closed 8 months ago

balzss commented 8 months ago

INSTUI-3960

test plan:

class Example extends React.Component {
  state = { description: "Hello World" };

  handleChange = (e) => this.setState({ description: e.target.value });

  componentDidMount() {
    setTimeout(
      () =>
        this.setState({
          description:
            "The next render after mounting causes wrong outline when using custom paddings",
        }),
      0
    );
  }

  render() {
    return (
      <TextArea
        textareaRef={(ref) => ref?.focus()}
        label="Description"
        value={this.state.description}
        onChange={this.handleChange}
        themeOverride={(_, { spacing }) => {
          return {
            padding: `${spacing.xxSmall} ${spacing.small}`,
          };
        }}
      />
    );
  }
}

render(<Example />);
github-actions[bot] commented 8 months ago

Preview URL: https://1422--preview-instui.netlify.app