Skip to content

[Autocomplete] Get root elements of options via renderOption#22591

Merged
oliviertassinari merged 2 commits intomui:nextfrom
ImanMahmoudinasab:autocomplete-render-option-accepts-root-element
Sep 15, 2020
Merged

[Autocomplete] Get root elements of options via renderOption#22591
oliviertassinari merged 2 commits intomui:nextfrom
ImanMahmoudinasab:autocomplete-render-option-accepts-root-element

Conversation

@ImanMahmoudinasab
Copy link
Contributor

@ImanMahmoudinasab ImanMahmoudinasab commented Sep 13, 2020

Breaking changes

  • [Autocomplete] Expose the full DOM structure
<Autocomplete
- renderOption={(option, { selected }) => (
-   <React.Fragment>
+ renderOption={(props, option, { selected }) => (
+   <li {...props}>
      <Checkbox
        icon={icon}
        checkedIcon={checkedIcon}
        style={{ marginRight: 8 }}
        checked={selected}
      />
      {option.title}
-   </React.Fragment>
+   </li>
  )}
/>

Closes #19254

@mui-pr-bot
Copy link

mui-pr-bot commented Sep 13, 2020

Details of bundle changes

Generated by 🚫 dangerJS against f54050c

@oliviertassinari oliviertassinari added scope: autocomplete Changes related to the autocomplete. This includes ComboBox. breaking change Introduces changes that are not backward compatible. labels Sep 14, 2020
@oliviertassinari oliviertassinari added the type: new feature Expand the scope of the product to solve a new problem. label Sep 14, 2020
@oliviertassinari
Copy link
Member

@ImanMahmoudinasab It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible. scope: autocomplete Changes related to the autocomplete. This includes ComboBox. type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Autocomplete] Simplify tooltip usage in options

3 participants