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

SelectField works slowly #2859

Closed
kodermax opened this issue Jan 9, 2016 · 8 comments
Closed

SelectField works slowly #2859

kodermax opened this issue Jan 9, 2016 · 8 comments

Comments

@kodermax
Copy link
Contributor

kodermax commented Jan 9, 2016

<SelectField
        floatingLabelStyle={{color: "black"}}
        floatingLabelText={this.state.labelText}
        hintText="Ресурс"
        hintStyle={{color: 'black'}}
        errorText={this.props.errorText}
        value={this.state.selectValue}
        onChange={this.handleSelectChange.bind(null, 'selectValue')}
      >
        {
          this.props.items.map(function (result) {
            let menuItems = [];
            menuItems.push(<MenuItem disabled={true} value={result.id} key={result.id} primaryText={result.title}
                                     style={categoryStyle}/>);
            if (result.items) {
              result.items.map(function (item) {
                menuItems.push(<MenuItem key={item.id} value={item.id} primaryText={item.title}/>);
              });
            }
            return menuItems;
          }
          )
        }
      </SelectField>

if we have more 10 items, selectfield open menu slowly.
My code For example

@Shearerbeard
Copy link

Same here - seems like the performance degrades exponentially depending on how many selects are on the screen at once:

function generateLocations(locs) {
    return locs.map(loc =>
        <MenuItem key={loc.ID} value={loc.ID} primaryText={loc.Name} />
    );
}

<TableRowColumn colSpan="3" style={selectCellStyle}>
    <SelectField onClick={handleTouchTapCancel}
             value={currentLocation}
             onChange={(e, i, val) => locationHandler(val)} >
        {generateLocations(locations)}
    </SelectField>
</TableRowColumn>

@Shearerbeard
Copy link

I think its also worth mentioning that this issue showed up when we upgraded from 0.13.1 to 0.14.2.

@antoinerousseau
Copy link
Contributor

same issue for me, it's unusable with a list of currencies (150 entries)

using 0.14.3

@edgesoft
Copy link

Same for me. Have a list with 300 items and it takes 3 seconds to close/open it!

@TintypeMolly
Copy link

Is there any way to solve this problem without upgrading whole material ui package to higher(maybe lower) version?

I'm experiencing super slow pages because of these select fields.
(Any page without select field is fine. awesome)

And I cannot figure out what caused this.

What should I override to work-around this problem?

Can anyone help?

For me, it slows the whole page by just being there without opening or closing it.

@nathanmarks
Copy link
Member

Hey guys,

We're aware of the performance issues with several components. Rest assured there are plans to address a lot of these issues in the near future. We just want to make sure that we take the right direction when we do so.

@mui mui locked and limited conversation to collaborators Mar 29, 2016
@nathanmarks
Copy link
Member

Locking this so people stop +1ing

@nathanmarks
Copy link
Member

Closing in favour of #3289

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants