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

Minor documentation bug on AutoComplete component page #7296

Closed
jcheroske opened this issue Jun 30, 2017 · 5 comments
Closed

Minor documentation bug on AutoComplete component page #7296

jcheroske opened this issue Jun 30, 2017 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@jcheroske
Copy link

Problem description

Documentation for AutoComplete props is incorrect. The following passage:

Other properties (not documented) are applied to the root element.

Should read:

Other properties (not documented) are applied to the TextField element.
@oliviertassinari
Copy link
Member

I would rather say that it's an issue with the API of the AutoComplete. We can't do much without introducing a breaking change.

@jcheroske
Copy link
Author

jcheroske commented Jun 30, 2017 via email

@oliviertassinari
Copy link
Member

@jcheroske You are right. My point is that the comment should be enforce accros the component for simplicity. Making the code matchs the comment would introduce a breaking change. Given that the documentation is automatically generated. I would rather wait on the migration of the component to the v1-alpha branch. I hope that's more clear putted this way.

@jcheroske
Copy link
Author

Just to be clear, here's what I'm talking about:

<div style={prepareStyles(Object.assign(styles.root, style))} > // <- This is the root & root style
        <TextField
          ref="searchTextField"
          autoComplete="off"
          onBlur={this.handleBlur}
          onFocus={this.handleFocus}
          onKeyDown={this.handleKeyDown}
          floatingLabelText={floatingLabelText}
          hintText={hintText}
          fullWidth={fullWidth}
          multiLine={false}
          errorStyle={errorStyle}
          style={textFieldStyle} <-------------------------- The style is not the root style!
          {...other} // <----------------------------------- The extra props are going here
          // value and onChange are idiomatic properties often leaked.
          // We prevent their overrides in order to reduce potential bugs.
          value={searchText}
          onChange={this.handleChange}
        />
        <Popover
          style={Object.assign({}, styles.popover, popoverStyle)}
          canAutoPosition={false}
          anchorOrigin={anchorOrigin}
          targetOrigin={targetOrigin}
          open={open}
          anchorEl={anchorEl}
          useLayerForClickAway={false}
          onRequestClose={this.handleRequestClose}
          animated={animated}
          animation={animation}
          {...popoverOther}
        >
          {menu}
        </Popover>
      </div>

The root is getting the root style, but not the props, even though the docs specifically say that the props go to the root. This is simply incorrect.

@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists and removed bug 🐛 Something doesn't work component: AutoComplete labels Jun 30, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 30, 2017

Duplicate of #6292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants