diff --git a/packages/strapi-plugin-content-manager/public/app/components/LimitSelect/index.js b/packages/strapi-plugin-content-manager/public/app/components/LimitSelect/index.js index ddbf64ec7a..5b7953a80d 100644 --- a/packages/strapi-plugin-content-manager/public/app/components/LimitSelect/index.js +++ b/packages/strapi-plugin-content-manager/public/app/components/LimitSelect/index.js @@ -5,10 +5,16 @@ */ import React from 'react'; +import _ from 'lodash'; import styles from './styles.scss'; class LimitSelect extends React.Component { // eslint-disable-line react/prefer-stateless-function + componentWillMount() { + const id = _.uniqueId(); + this.setState({ id }); + } + getOptionsValues() { return [{ value: 10, @@ -30,16 +36,20 @@ class LimitSelect extends React.Component { // eslint-disable-line react/prefer- } render() { + // Generate options const options = this.getOptionsValues().map((optionValue) => ( )); + // Get id in order to link the `label` and the `select` elements + const id = this.state.id; + return (
- +
- {options}