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

[TextField] Cursor jumps to the end when async update #572

Closed
strblr opened this issue Oct 6, 2017 · 3 comments
Closed

[TextField] Cursor jumps to the end when async update #572

strblr opened this issue Oct 6, 2017 · 3 comments
Labels
Milestone

Comments

@strblr
Copy link

strblr commented Oct 6, 2017

Description

Here is my case : I have a TextField that updates with the user input only after server validation. So onChange makes a socket request to the server, and the server sends the validated typed value back. Only then, the TextField is updated with the validated value. Performance is not the issue : this is almost as fast as typing in a TextField updated with classic setState. But I can't figure out why the cursor is always jumping to the end. This makes inner and front text edits a big deal.

After some researchs, I found this guy who had the same issue on InfernoJS :
infernojs/inferno#738

And it seems like a bug due to async updates. On the same thread, they gave two turnarounds :

  • Using setStateSync (sadly only available in Inferno, not React)
  • Using defaultValue instead of value prop to set the TextField value. This is my current "solution". It's not perfect since it doesn't seem to update when a new defaultValue prop is passed without having typed anything.

Maybe this can give an insight too : facebook/react#955
https://stackoverflow.com/questions/28922275/in-reactjs-why-does-setstate-behave-differently-when-called-synchronously/28922465#28922465

Edit: I found a good explanation here : https://stackoverflow.com/a/28922465
I'm wondering if there is any easy trick to solve this. Any advice ?

Version

  • React - 16
  • React-MD - 1.1.7
  • Browser - Chrome 61.0.3163.79
@strblr
Copy link
Author

strblr commented Oct 6, 2017

I found a solution. I'll explain the whole thing here, maybe this can save some people's time.

The problem of seeing the cursor jump to the end actually happens each time a controlled input gets its new value asynchronously. To sumup some of my researchs, here is what happens :

Explanation

When the input is controlled synchronously (cursor doesn't jump) :

  • input.value is 'Hello' (cursor in the middle)
  • You type 'X'
  • input.value is 'HelXlo' (cursor in the middle)
  • Call of setState({ value: 'HelXlo' })
  • The virtual dom says the input value should be 'HelXlo'
  • input.value is actually 'HelXlo'
  • No action is taken, cursor stays in the middle

When the input is controlled asynchronously (cursor jumps) :

  • input.value is 'Hello' (cursor in the middle)
  • You type 'X'
  • input.value is 'HelXlo' (cursor in the middle)
  • You don't call setState but call your async onChange('HelXlo')
  • The virtual dom says the input value should be 'Hello' (last known prop)
  • React sets input.value to 'Hello'
  • Cursor jumps to the end (side-effect of setting input.value). By the way, this is why the cursor jumps to the end when you provide a value prop without any onChange prop.
  • ...
  • Then later, when onChange is done :
  • Call of componentWillReceiveProps({ value: 'HelXlo' })
  • Call of setState({ value: 'HelXlo' })
  • The virtual dom says the input value should be 'HelXlo'
  • React sets input.value to 'HelXlo'
  • Cursor re-jumps to the end (side-effect of setting input.value)

Solution

The solution is to do both sync and async control in a little wrapper. You call prop onChange (for async control) only when the setState (sync control) is done. This gives you the following scenario :

  • input.value is 'Hello' (cursor in the middle)
  • You type 'X'
  • input.value is 'HelXlo' (cursor in the middle)
  • Call of setState({ value: 'HelXlo' }), then call of onChange('HelXlo')
  • The virtual dom says the input value should be 'HelXlo'
  • input.value is actually 'HelXlo'
  • No action is taken, cursor stays in the middle
  • ...
  • Then later, when onChange is done :
  • Call of componentWillReceiveProps({ value: 'HelXlo' })
  • Call of setState({ value: 'HelXlo' })
  • The virtual dom says the input value should be 'HelXlo'
  • input.value is actually 'HelXlo'
  • No action is taken, cursor stays in the middle

And here is the wrapper :

class AsyncTextField extends React.PureComponent {
    constructor(props) {
        super(props);
        this.state = { value: this.props.value }
    }

    componentWillReceiveProps(newProps) {
        this.setState({ value: newProps.value });
    }

    onChange(value) {
        this.setState({ value }, () => this.props.onChange(value));
    }

    render() {
        let { value, onChange, ...props } = this.props;
        return (
            <TextField value={ this.state.value } onChange={ ::this.onChange } { ...props }/>
        );
    }
}

This can be easily adapted to other input components.
It can also be used for concurrent editing of the same TextField. The only limit in that case is that when A types, B sees his cursor jumping to the end. At least, A's cursor doesn't jump anymore. There's pretty much nothing you can do about this issue without controlling the cursor manually.

Hope this will help.

@jbetancur
Copy link

jbetancur commented Jan 8, 2018

I am having the same issue but when using TextField with redux-form. Interestingly though, if I pull out maxLength this issues goes away

const InputField = ({ input, meta: { touched, error }, maxLength, ...others }) => (
  <TextField
    id={input.name}
    error={touched && !!error}
    errorText={error}
    {...input}
    {...others}
  />
);

@jbetancur
Copy link

jbetancur commented Feb 23, 2018

Redux-Form Workaround

This one has been a doozy, but I figured out a workaround for this when using redux-form. Hopefully, this helps folks that have this same issue.

Note this only happens when using maxLength on a TextField and it does not happen on a textarea input (i.e. TextField with rows)

import React, { PureComponent } from 'react';
import { TextField } from 'react-md';

/* eslint-disable react/prop-types */
class InputField extends PureComponent {
  constructor(props) {
    super(props);

    this.state = {
      value: props.input.value,
    };
  }

  handleInputChange = (value) => {
    const { input: { onChange } } = this.props;

    this.setState({ value });

    if (onChange) {
      onChange(event);
    }
  }

  render() {
    const { input: { value, onChange, ...input }, meta: { touched, error }, ...others } = this.props;

    return (
      <TextField
        id={input.name}
        error={touched && !!error}
        errorText={error}
        onChange={this.handleInputChange}
        value={this.state.value}
        {...input}
        {...others}
      />
    );
  }
}

export default InputField;

@mlaursen mlaursen added this to the v2.0.0 milestone Apr 29, 2019
@mlaursen mlaursen added the bug label Apr 29, 2019
mlaursen added a commit that referenced this issue Jun 11, 2020
This should hopefully be the last commit required for the v2 release.
Tagging all the open v2 targeted github issues below so they auto close
once this is merged.

- Closes #826 (v2 status ticket)
- Closes #697
- Closes #854 with the new documentation for [self hosting fonts with relative paths]
- Closes #851, closes #642 with the new [ExpansionPanel] components
- Closes #850, closes #641, closes #600, closes #594, closes #554, closes #519, closes #406, closes #405, closes #404, closes #399, closes #289, closes #237 with the new [Table] components and the new [useIndeterminateChecked] hook
- Closes #848, closes #816, closes #788 since v2 no longer uses deprecated lifecycle methods and is purely function component based. (react-transition-group uses `findDOMNode` though right now)
- Closes #844 since this is available in the [@react-md/sheet package]
- Closes #842 due to re-writing the `Collapse` component
- Closes #824, closes #820, closes #771, closes #707, closes #693, closes #687, closes #654, closes #577, closes #270 due to the new [Tabs API]
- Closes #823, closes #714, closes #705 with the new [Menu components]
- Closes #822 since the new [@react-md/form package] added the new styles.
- Closes #819 with the new [SimpleListItem] and [ListItemChildren (preferred)] components
- Closes #818 with the new focus behavior
- Closes #804, closes #765, closes #743, closes #731, closes #730, closes #671, closes #607, closes #387 with the new [NativeSelect] and [Select] implementations
- Closes #802, closes #762, closes #761, closes #572, closes #486, closes #408, closes #314, closes #312 with the new [TextField] implementation
- Closes #791, closes #780, closes #425 with the new [AutoComplete] implementation
- Closes #770 with the new [FixedDialog] component
- Closes #721, closes #640, closes #407 with the new [Grid] and [GridList] implementations
- Closes #719 with the new [Radio] component
- Closes #706, closes #683 with the new [Button] component
- Closes #695 with the new [Theme API]
- Closes #691 with the new [FileInput] component
- Closes #689 with the new [Tabs API] and [Menu components]
- Closes #674, closes #413 with the new [@react-md/alert package]
- Closes #658 with the new [Menu components] and [@react-md/tree package]
- Closes #582 with the new [Chip] component
- Closes #497, closes #455, closes #419 with the new [@react-md/layout package]
- Closes #496 with the new [Switch] component
- Closes #239, closes #157 with the new [Tooltip] component

[self hosting fonts with relative paths]: https://react-md.dev/guides/advanced-installation#using-relative-paths-for-fonts
[useIndeterminateChecked hook]: https://react-md.dev/packages/form/demos#indeterminate-checkboxes-title
[@react-md/alert package]: https://react-md.dev/packages/alert/demos
[@react-md/layout package]: https://react-md.dev/packages/layout/demos
[@react-md/form package]: https://react-md.dev/packages/form/demos
[@react-md/sheet package]: https://react-md.dev/packages/sheet/demos
[@react-md/tree package]: https://react-md.dev/packages/tree/demos
[Theme API]: https://react-md.dev/guides/customizing-your-theme
[Tabs api]: https://react-md.dev/packages/tabs/demos
[Button]: https://react-md.dev/packages/button/demos
[Chip]: https://react-md.dev/packages/chip/demos
[ExpansionPanel]: https://react-md.dev/packages/button/demos
[menu components]: https://react-md.dev/packages/menu/demos
[FileInput]: https://react-md.dev/packages/form/demos#file-input-example-title
[Switch]: https://react-md.dev/packages/form/demos#switch-examples-title
[NativeSelect]: https://react-md.dev/packages/form/demos#native-select-example-title
[Select]: https://react-md.dev/packages/form/demos#select-example-title
[Tooltip]: https://react-md.dev/packages/tooltip/demos
[AutoComplete]: https://react-md.dev/packages/autocomplete/demos
[FixedDialog]: https://react-md.dev/packages/dialog/demos#fixed-dialog-example-title
[TextField]: https://react-md.dev/packages/form/demos#text-field-example-title
[Radio]: https://react-md.dev/packages/form/demos#checkbox-and-radio-examples-title
[Grid]: https://react-md.dev/packages/utils/demos#material-grid-example-title
[GridList]: https://react-md.dev/packages/utils/demos#simple-grid-list-example-title
[SimpleListItem]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/SimpleListItem.tsx
[ListItemChildren]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/ListItemChildren.tsx
@mlaursen mlaursen mentioned this issue Jun 11, 2020
mlaursen added a commit that referenced this issue Jun 11, 2020
This should hopefully be the last commit required for the v2 release.
Tagging all the open v2 targeted github issues below so they auto close once this is merged.

- Closes #826 (v2 status ticket)
- Closes #697
- Closes #854 with the new documentation for [self hosting fonts with relative paths]
- Closes #851, closes #642 with the new [ExpansionPanel] components
- Closes #850, closes #641, closes #600, closes #594, closes #554, closes #519, closes #406, closes #405, closes #404, closes #399, closes #289, closes #237 with the new [Table] components and the new [useIndeterminateChecked] hook
- Closes #848, closes #816, closes #788 since v2 no longer uses deprecated lifecycle methods and is purely function component based. (react-transition-group uses `findDOMNode` though right now)
- Closes #844 since this is available in the [@react-md/sheet package]
- Closes #842 due to re-writing the `Collapse` component
- Closes #824, closes #820, closes #771, closes #707, closes #693, closes #687, closes #654, closes #577, closes #270 due to the new [Tabs API]
- Closes #823, closes #714, closes #705 with the new [Menu components]
- Closes #822 since the new [@react-md/form package] added the new styles.
- Closes #819 with the new [SimpleListItem] and [ListItemChildren (preferred)] components
- Closes #818 with the new focus behavior
- Closes #804, closes #765, closes #743, closes #731, closes #730, closes #671, closes #607, closes #387 with the new [NativeSelect] and [Select] implementations
- Closes #802, closes #762, closes #761, closes #572, closes #486, closes #408, closes #314, closes #312 with the new [TextField] implementation
- Closes #791, closes #780, closes #425, closes #633 with the new [AutoComplete] implementation
- Closes #770 with the new [FixedDialog] component
- Closes #721, closes #640, closes #407 with the new [Grid] and [GridList] implementations
- Closes #719 with the new [Radio] component
- Closes #706, closes #683 with the new [Button] component
- Closes #695 with the new [Theme API]
- Closes #691 with the new [FileInput] component
- Closes #689 with the new [Tabs API] and [Menu components]
- Closes #674, closes #413 with the new [@react-md/alert package]
- Closes #658 with the new [Menu components] and [@react-md/tree package]
- Closes #582 with the new [Chip] component
- Closes #497, closes #455, closes #419 with the new [@react-md/layout package]
- Closes #496 with the new [Switch] component
- Closes #239, closes #157 with the new [Tooltip] component

[self hosting fonts with relative paths]: https://react-md.dev/guides/advanced-installation#using-relative-paths-for-fonts
[useIndeterminateChecked hook]: https://react-md.dev/packages/form/demos#indeterminate-checkboxes-title
[@react-md/alert package]: https://react-md.dev/packages/alert/demos
[@react-md/layout package]: https://react-md.dev/packages/layout/demos
[@react-md/form package]: https://react-md.dev/packages/form/demos
[@react-md/sheet package]: https://react-md.dev/packages/sheet/demos
[@react-md/tree package]: https://react-md.dev/packages/tree/demos
[Theme API]: https://react-md.dev/guides/customizing-your-theme
[Tabs api]: https://react-md.dev/packages/tabs/demos
[Button]: https://react-md.dev/packages/button/demos
[Chip]: https://react-md.dev/packages/chip/demos
[ExpansionPanel]: https://react-md.dev/packages/button/demos
[menu components]: https://react-md.dev/packages/menu/demos
[FileInput]: https://react-md.dev/packages/form/demos#file-input-example-title
[Switch]: https://react-md.dev/packages/form/demos#switch-examples-title
[NativeSelect]: https://react-md.dev/packages/form/demos#native-select-example-title
[Select]: https://react-md.dev/packages/form/demos#select-example-title
[Tooltip]: https://react-md.dev/packages/tooltip/demos
[Table]: https://react-md.dev/packages/table/demos
[AutoComplete]: https://react-md.dev/packages/autocomplete/demos
[FixedDialog]: https://react-md.dev/packages/dialog/demos#fixed-dialog-example-title
[TextField]: https://react-md.dev/packages/form/demos#text-field-example-title
[Radio]: https://react-md.dev/packages/form/demos#checkbox-and-radio-examples-title
[Grid]: https://react-md.dev/packages/utils/demos#material-grid-example-title
[GridList]: https://react-md.dev/packages/utils/demos#simple-grid-list-example-title
[SimpleListItem]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/SimpleListItem.tsx
[ListItemChildren (preferred)]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/ListItemChildren.tsx
[useIndeterminateChecked]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/form/src/useIndeterminateChecked.ts
pull bot pushed a commit to JCofman/react-md that referenced this issue Jun 15, 2020
This should hopefully be the last commit required for the v2 release.
Tagging all the open v2 targeted github issues below so they auto close once this is merged.

- Closes mlaursen#826 (v2 status ticket)
- Closes mlaursen#697
- Closes mlaursen#854 with the new documentation for [self hosting fonts with relative paths]
- Closes mlaursen#851, closes mlaursen#642 with the new [ExpansionPanel] components
- Closes mlaursen#850, closes mlaursen#641, closes mlaursen#600, closes mlaursen#594, closes mlaursen#554, closes mlaursen#519, closes mlaursen#406, closes mlaursen#405, closes mlaursen#404, closes mlaursen#399, closes #289, closes #237 with the new [Table] components and the new [useIndeterminateChecked] hook
- Closes mlaursen#848, closes mlaursen#816, closes mlaursen#788 since v2 no longer uses deprecated lifecycle methods and is purely function component based. (react-transition-group uses `findDOMNode` though right now)
- Closes mlaursen#844 since this is available in the [@react-md/sheet package]
- Closes mlaursen#842 due to re-writing the `Collapse` component
- Closes mlaursen#824, closes mlaursen#820, closes mlaursen#771, closes mlaursen#707, closes mlaursen#693, closes mlaursen#687, closes mlaursen#654, closes mlaursen#577, closes #270 due to the new [Tabs API]
- Closes mlaursen#823, closes mlaursen#714, closes mlaursen#705 with the new [Menu components]
- Closes mlaursen#822 since the new [@react-md/form package] added the new styles.
- Closes mlaursen#819 with the new [SimpleListItem] and [ListItemChildren (preferred)] components
- Closes mlaursen#818 with the new focus behavior
- Closes mlaursen#804, closes mlaursen#765, closes mlaursen#743, closes mlaursen#731, closes mlaursen#730, closes mlaursen#671, closes mlaursen#607, closes mlaursen#387 with the new [NativeSelect] and [Select] implementations
- Closes mlaursen#802, closes mlaursen#762, closes mlaursen#761, closes mlaursen#572, closes mlaursen#486, closes mlaursen#408, closes mlaursen#314, closes mlaursen#312 with the new [TextField] implementation
- Closes mlaursen#791, closes mlaursen#780, closes mlaursen#425, closes mlaursen#633 with the new [AutoComplete] implementation
- Closes mlaursen#770 with the new [FixedDialog] component
- Closes mlaursen#721, closes mlaursen#640, closes mlaursen#407 with the new [Grid] and [GridList] implementations
- Closes mlaursen#719 with the new [Radio] component
- Closes mlaursen#706, closes mlaursen#683 with the new [Button] component
- Closes mlaursen#695 with the new [Theme API]
- Closes mlaursen#691 with the new [FileInput] component
- Closes mlaursen#689 with the new [Tabs API] and [Menu components]
- Closes mlaursen#674, closes mlaursen#413 with the new [@react-md/alert package]
- Closes mlaursen#658 with the new [Menu components] and [@react-md/tree package]
- Closes mlaursen#582 with the new [Chip] component
- Closes mlaursen#497, closes mlaursen#455, closes mlaursen#419 with the new [@react-md/layout package]
- Closes mlaursen#496 with the new [Switch] component
- Closes #239, closes #157 with the new [Tooltip] component

[self hosting fonts with relative paths]: https://react-md.dev/guides/advanced-installation#using-relative-paths-for-fonts
[useIndeterminateChecked hook]: https://react-md.dev/packages/form/demos#indeterminate-checkboxes-title
[@react-md/alert package]: https://react-md.dev/packages/alert/demos
[@react-md/layout package]: https://react-md.dev/packages/layout/demos
[@react-md/form package]: https://react-md.dev/packages/form/demos
[@react-md/sheet package]: https://react-md.dev/packages/sheet/demos
[@react-md/tree package]: https://react-md.dev/packages/tree/demos
[Theme API]: https://react-md.dev/guides/customizing-your-theme
[Tabs api]: https://react-md.dev/packages/tabs/demos
[Button]: https://react-md.dev/packages/button/demos
[Chip]: https://react-md.dev/packages/chip/demos
[ExpansionPanel]: https://react-md.dev/packages/button/demos
[menu components]: https://react-md.dev/packages/menu/demos
[FileInput]: https://react-md.dev/packages/form/demos#file-input-example-title
[Switch]: https://react-md.dev/packages/form/demos#switch-examples-title
[NativeSelect]: https://react-md.dev/packages/form/demos#native-select-example-title
[Select]: https://react-md.dev/packages/form/demos#select-example-title
[Tooltip]: https://react-md.dev/packages/tooltip/demos
[Table]: https://react-md.dev/packages/table/demos
[AutoComplete]: https://react-md.dev/packages/autocomplete/demos
[FixedDialog]: https://react-md.dev/packages/dialog/demos#fixed-dialog-example-title
[TextField]: https://react-md.dev/packages/form/demos#text-field-example-title
[Radio]: https://react-md.dev/packages/form/demos#checkbox-and-radio-examples-title
[Grid]: https://react-md.dev/packages/utils/demos#material-grid-example-title
[GridList]: https://react-md.dev/packages/utils/demos#simple-grid-list-example-title
[SimpleListItem]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/SimpleListItem.tsx
[ListItemChildren (preferred)]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/ListItemChildren.tsx
[useIndeterminateChecked]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/form/src/useIndeterminateChecked.ts
mlaursen added a commit that referenced this issue Jun 15, 2020
This should hopefully be the last commit required for the v2 release.
Tagging all the open v2 targeted github issues below so they auto close once this is merged.

- Closes #826 (v2 status ticket)
- Closes #697
- Closes #854 with the new documentation for [self hosting fonts with relative paths]
- Closes #851, closes #642 with the new [ExpansionPanel] components
- Closes #850, closes #641, closes #600, closes #594, closes #554, closes #519, closes #406, closes #405, closes #404, closes #399, closes #289, closes #237 with the new [Table] components and the new [useIndeterminateChecked] hook
- Closes #848, closes #816, closes #788 since v2 no longer uses deprecated lifecycle methods and is purely function component based. (react-transition-group uses `findDOMNode` though right now)
- Closes #844 since this is available in the [@react-md/sheet package]
- Closes #842 due to re-writing the `Collapse` component
- Closes #824, closes #820, closes #771, closes #707, closes #693, closes #687, closes #654, closes #577, closes #270 due to the new [Tabs API]
- Closes #823, closes #714, closes #705 with the new [Menu components]
- Closes #822 since the new [@react-md/form package] added the new styles.
- Closes #819 with the new [SimpleListItem] and [ListItemChildren (preferred)] components
- Closes #818 with the new focus behavior
- Closes #804, closes #765, closes #743, closes #731, closes #730, closes #671, closes #607, closes #387 with the new [NativeSelect] and [Select] implementations
- Closes #802, closes #762, closes #761, closes #572, closes #486, closes #408, closes #314, closes #312 with the new [TextField] implementation
- Closes #791, closes #780, closes #425, closes #633 with the new [AutoComplete] implementation
- Closes #770 with the new [FixedDialog] component
- Closes #721, closes #640, closes #407 with the new [Grid] and [GridList] implementations
- Closes #719 with the new [Radio] component
- Closes #706, closes #683 with the new [Button] component
- Closes #695 with the new [Theme API]
- Closes #691 with the new [FileInput] component
- Closes #689 with the new [Tabs API] and [Menu components]
- Closes #674, closes #413 with the new [@react-md/alert package]
- Closes #658 with the new [Menu components] and [@react-md/tree package]
- Closes #582 with the new [Chip] component
- Closes #497, closes #455, closes #419 with the new [@react-md/layout package]
- Closes #496 with the new [Switch] component
- Closes #239, closes #157 with the new [Tooltip] component

[self hosting fonts with relative paths]: https://react-md.dev/guides/advanced-installation#using-relative-paths-for-fonts
[useIndeterminateChecked hook]: https://react-md.dev/packages/form/demos#indeterminate-checkboxes-title
[@react-md/alert package]: https://react-md.dev/packages/alert/demos
[@react-md/layout package]: https://react-md.dev/packages/layout/demos
[@react-md/form package]: https://react-md.dev/packages/form/demos
[@react-md/sheet package]: https://react-md.dev/packages/sheet/demos
[@react-md/tree package]: https://react-md.dev/packages/tree/demos
[Theme API]: https://react-md.dev/guides/customizing-your-theme
[Tabs api]: https://react-md.dev/packages/tabs/demos
[Button]: https://react-md.dev/packages/button/demos
[Chip]: https://react-md.dev/packages/chip/demos
[ExpansionPanel]: https://react-md.dev/packages/button/demos
[menu components]: https://react-md.dev/packages/menu/demos
[FileInput]: https://react-md.dev/packages/form/demos#file-input-example-title
[Switch]: https://react-md.dev/packages/form/demos#switch-examples-title
[NativeSelect]: https://react-md.dev/packages/form/demos#native-select-example-title
[Select]: https://react-md.dev/packages/form/demos#select-example-title
[Tooltip]: https://react-md.dev/packages/tooltip/demos
[Table]: https://react-md.dev/packages/table/demos
[AutoComplete]: https://react-md.dev/packages/autocomplete/demos
[FixedDialog]: https://react-md.dev/packages/dialog/demos#fixed-dialog-example-title
[TextField]: https://react-md.dev/packages/form/demos#text-field-example-title
[Radio]: https://react-md.dev/packages/form/demos#checkbox-and-radio-examples-title
[Grid]: https://react-md.dev/packages/utils/demos#material-grid-example-title
[GridList]: https://react-md.dev/packages/utils/demos#simple-grid-list-example-title
[SimpleListItem]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/SimpleListItem.tsx
[ListItemChildren (preferred)]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/ListItemChildren.tsx
[useIndeterminateChecked]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/form/src/useIndeterminateChecked.ts
pull bot pushed a commit to JCofman/react-md that referenced this issue Jun 15, 2020
* chore(docs): Started initial v2 Release Notes/Blog

* chore(docs): Updated documentation for {{RMD_VERSION}}

This should hopefully be the last commit required for the v2 release.
Tagging all the open v2 targeted github issues below so they auto close once this is merged.

- Closes mlaursen#826 (v2 status ticket)
- Closes mlaursen#697
- Closes mlaursen#854 with the new documentation for [self hosting fonts with relative paths]
- Closes mlaursen#851, closes mlaursen#642 with the new [ExpansionPanel] components
- Closes mlaursen#850, closes mlaursen#641, closes mlaursen#600, closes mlaursen#594, closes mlaursen#554, closes mlaursen#519, closes mlaursen#406, closes mlaursen#405, closes mlaursen#404, closes mlaursen#399, closes #289, closes #237 with the new [Table] components and the new [useIndeterminateChecked] hook
- Closes mlaursen#848, closes mlaursen#816, closes mlaursen#788 since v2 no longer uses deprecated lifecycle methods and is purely function component based. (react-transition-group uses `findDOMNode` though right now)
- Closes mlaursen#844 since this is available in the [@react-md/sheet package]
- Closes mlaursen#842 due to re-writing the `Collapse` component
- Closes mlaursen#824, closes mlaursen#820, closes mlaursen#771, closes mlaursen#707, closes mlaursen#693, closes mlaursen#687, closes mlaursen#654, closes mlaursen#577, closes #270 due to the new [Tabs API]
- Closes mlaursen#823, closes mlaursen#714, closes mlaursen#705 with the new [Menu components]
- Closes mlaursen#822 since the new [@react-md/form package] added the new styles.
- Closes mlaursen#819 with the new [SimpleListItem] and [ListItemChildren (preferred)] components
- Closes mlaursen#818 with the new focus behavior
- Closes mlaursen#804, closes mlaursen#765, closes mlaursen#743, closes mlaursen#731, closes mlaursen#730, closes mlaursen#671, closes mlaursen#607, closes mlaursen#387 with the new [NativeSelect] and [Select] implementations
- Closes mlaursen#802, closes mlaursen#762, closes mlaursen#761, closes mlaursen#572, closes mlaursen#486, closes mlaursen#408, closes mlaursen#314, closes mlaursen#312 with the new [TextField] implementation
- Closes mlaursen#791, closes mlaursen#780, closes mlaursen#425, closes mlaursen#633 with the new [AutoComplete] implementation
- Closes mlaursen#770 with the new [FixedDialog] component
- Closes mlaursen#721, closes mlaursen#640, closes mlaursen#407 with the new [Grid] and [GridList] implementations
- Closes mlaursen#719 with the new [Radio] component
- Closes mlaursen#706, closes mlaursen#683 with the new [Button] component
- Closes mlaursen#695 with the new [Theme API]
- Closes mlaursen#691 with the new [FileInput] component
- Closes mlaursen#689 with the new [Tabs API] and [Menu components]
- Closes mlaursen#674, closes mlaursen#413 with the new [@react-md/alert package]
- Closes mlaursen#658 with the new [Menu components] and [@react-md/tree package]
- Closes mlaursen#582 with the new [Chip] component
- Closes mlaursen#497, closes mlaursen#455, closes mlaursen#419 with the new [@react-md/layout package]
- Closes mlaursen#496 with the new [Switch] component
- Closes #239, closes #157 with the new [Tooltip] component

[self hosting fonts with relative paths]: https://react-md.dev/guides/advanced-installation#using-relative-paths-for-fonts
[useIndeterminateChecked hook]: https://react-md.dev/packages/form/demos#indeterminate-checkboxes-title
[@react-md/alert package]: https://react-md.dev/packages/alert/demos
[@react-md/layout package]: https://react-md.dev/packages/layout/demos
[@react-md/form package]: https://react-md.dev/packages/form/demos
[@react-md/sheet package]: https://react-md.dev/packages/sheet/demos
[@react-md/tree package]: https://react-md.dev/packages/tree/demos
[Theme API]: https://react-md.dev/guides/customizing-your-theme
[Tabs api]: https://react-md.dev/packages/tabs/demos
[Button]: https://react-md.dev/packages/button/demos
[Chip]: https://react-md.dev/packages/chip/demos
[ExpansionPanel]: https://react-md.dev/packages/button/demos
[menu components]: https://react-md.dev/packages/menu/demos
[FileInput]: https://react-md.dev/packages/form/demos#file-input-example-title
[Switch]: https://react-md.dev/packages/form/demos#switch-examples-title
[NativeSelect]: https://react-md.dev/packages/form/demos#native-select-example-title
[Select]: https://react-md.dev/packages/form/demos#select-example-title
[Tooltip]: https://react-md.dev/packages/tooltip/demos
[Table]: https://react-md.dev/packages/table/demos
[AutoComplete]: https://react-md.dev/packages/autocomplete/demos
[FixedDialog]: https://react-md.dev/packages/dialog/demos#fixed-dialog-example-title
[TextField]: https://react-md.dev/packages/form/demos#text-field-example-title
[Radio]: https://react-md.dev/packages/form/demos#checkbox-and-radio-examples-title
[Grid]: https://react-md.dev/packages/utils/demos#material-grid-example-title
[GridList]: https://react-md.dev/packages/utils/demos#simple-grid-list-example-title
[SimpleListItem]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/SimpleListItem.tsx
[ListItemChildren (preferred)]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/ListItemChildren.tsx
[useIndeterminateChecked]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/form/src/useIndeterminateChecked.ts

* chore: Updates to look better in npm

Created a new `yarn dev-utils rmd-readme` script that will copy the root
README.md to the `react-md` folder and insert some additional
information into the README. This is just to help add documentation if
this package is found through npm instead of GitHub or other sources.

Also updated all the package.json files to link to their specific
documentation page as the `"homepage"` field.

* chore(docs): Removed API Routes

I haven't figured out how to generate the API docs yet and it's better
to remove these pages so it isn't included in search or lead to
confusion since there's nothing there.

Hopefully I'll be able to figure out typedoc, react-docgen-typescript,
or react-docgen (with the new typescript support) soon so it can be
added back.

* skip ci: Fixed travis badge to point to master

* fix(form): Fixed the Select component to be submitted with forms

Added the <input type=hidden /> back to the Select component so it can
be submitted in forms. Also changed a few of the ids.

* chore: Adding github label workflow

* chore: Trying automatic labelling workflow
pull bot pushed a commit to JCofman/react-md that referenced this issue Jun 15, 2020
* chore(docs): Started initial v2 Release Notes/Blog

* chore(docs): Updated documentation for {{RMD_VERSION}}

This should hopefully be the last commit required for the v2 release.
Tagging all the open v2 targeted github issues below so they auto close once this is merged.

- Closes mlaursen#826 (v2 status ticket)
- Closes mlaursen#697
- Closes mlaursen#854 with the new documentation for [self hosting fonts with relative paths]
- Closes mlaursen#851, closes mlaursen#642 with the new [ExpansionPanel] components
- Closes mlaursen#850, closes mlaursen#641, closes mlaursen#600, closes mlaursen#594, closes mlaursen#554, closes mlaursen#519, closes mlaursen#406, closes mlaursen#405, closes mlaursen#404, closes mlaursen#399, closes #289, closes #237 with the new [Table] components and the new [useIndeterminateChecked] hook
- Closes mlaursen#848, closes mlaursen#816, closes mlaursen#788 since v2 no longer uses deprecated lifecycle methods and is purely function component based. (react-transition-group uses `findDOMNode` though right now)
- Closes mlaursen#844 since this is available in the [@react-md/sheet package]
- Closes mlaursen#842 due to re-writing the `Collapse` component
- Closes mlaursen#824, closes mlaursen#820, closes mlaursen#771, closes mlaursen#707, closes mlaursen#693, closes mlaursen#687, closes mlaursen#654, closes mlaursen#577, closes #270 due to the new [Tabs API]
- Closes mlaursen#823, closes mlaursen#714, closes mlaursen#705 with the new [Menu components]
- Closes mlaursen#822 since the new [@react-md/form package] added the new styles.
- Closes mlaursen#819 with the new [SimpleListItem] and [ListItemChildren (preferred)] components
- Closes mlaursen#818 with the new focus behavior
- Closes mlaursen#804, closes mlaursen#765, closes mlaursen#743, closes mlaursen#731, closes mlaursen#730, closes mlaursen#671, closes mlaursen#607, closes mlaursen#387 with the new [NativeSelect] and [Select] implementations
- Closes mlaursen#802, closes mlaursen#762, closes mlaursen#761, closes mlaursen#572, closes mlaursen#486, closes mlaursen#408, closes mlaursen#314, closes mlaursen#312 with the new [TextField] implementation
- Closes mlaursen#791, closes mlaursen#780, closes mlaursen#425, closes mlaursen#633 with the new [AutoComplete] implementation
- Closes mlaursen#770 with the new [FixedDialog] component
- Closes mlaursen#721, closes mlaursen#640, closes mlaursen#407 with the new [Grid] and [GridList] implementations
- Closes mlaursen#719 with the new [Radio] component
- Closes mlaursen#706, closes mlaursen#683 with the new [Button] component
- Closes mlaursen#695 with the new [Theme API]
- Closes mlaursen#691 with the new [FileInput] component
- Closes mlaursen#689 with the new [Tabs API] and [Menu components]
- Closes mlaursen#674, closes mlaursen#413 with the new [@react-md/alert package]
- Closes mlaursen#658 with the new [Menu components] and [@react-md/tree package]
- Closes mlaursen#582 with the new [Chip] component
- Closes mlaursen#497, closes mlaursen#455, closes mlaursen#419 with the new [@react-md/layout package]
- Closes mlaursen#496 with the new [Switch] component
- Closes #239, closes #157 with the new [Tooltip] component

[self hosting fonts with relative paths]: https://react-md.dev/guides/advanced-installation#using-relative-paths-for-fonts
[useIndeterminateChecked hook]: https://react-md.dev/packages/form/demos#indeterminate-checkboxes-title
[@react-md/alert package]: https://react-md.dev/packages/alert/demos
[@react-md/layout package]: https://react-md.dev/packages/layout/demos
[@react-md/form package]: https://react-md.dev/packages/form/demos
[@react-md/sheet package]: https://react-md.dev/packages/sheet/demos
[@react-md/tree package]: https://react-md.dev/packages/tree/demos
[Theme API]: https://react-md.dev/guides/customizing-your-theme
[Tabs api]: https://react-md.dev/packages/tabs/demos
[Button]: https://react-md.dev/packages/button/demos
[Chip]: https://react-md.dev/packages/chip/demos
[ExpansionPanel]: https://react-md.dev/packages/button/demos
[menu components]: https://react-md.dev/packages/menu/demos
[FileInput]: https://react-md.dev/packages/form/demos#file-input-example-title
[Switch]: https://react-md.dev/packages/form/demos#switch-examples-title
[NativeSelect]: https://react-md.dev/packages/form/demos#native-select-example-title
[Select]: https://react-md.dev/packages/form/demos#select-example-title
[Tooltip]: https://react-md.dev/packages/tooltip/demos
[Table]: https://react-md.dev/packages/table/demos
[AutoComplete]: https://react-md.dev/packages/autocomplete/demos
[FixedDialog]: https://react-md.dev/packages/dialog/demos#fixed-dialog-example-title
[TextField]: https://react-md.dev/packages/form/demos#text-field-example-title
[Radio]: https://react-md.dev/packages/form/demos#checkbox-and-radio-examples-title
[Grid]: https://react-md.dev/packages/utils/demos#material-grid-example-title
[GridList]: https://react-md.dev/packages/utils/demos#simple-grid-list-example-title
[SimpleListItem]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/SimpleListItem.tsx
[ListItemChildren (preferred)]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/list/src/ListItemChildren.tsx
[useIndeterminateChecked]: https://github.com/mlaursen/react-md/blob/1a4161976fbb95233284c507c10063602d1cc682/packages/form/src/useIndeterminateChecked.ts

* chore: Updates to look better in npm

Created a new `yarn dev-utils rmd-readme` script that will copy the root
README.md to the `react-md` folder and insert some additional
information into the README. This is just to help add documentation if
this package is found through npm instead of GitHub or other sources.

Also updated all the package.json files to link to their specific
documentation page as the `"homepage"` field.

* chore(docs): Removed API Routes

I haven't figured out how to generate the API docs yet and it's better
to remove these pages so it isn't included in search or lead to
confusion since there's nothing there.

Hopefully I'll be able to figure out typedoc, react-docgen-typescript,
or react-docgen (with the new typescript support) soon so it can be
added back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants