question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Menu component: Let consumer add SearchInput/TextInput and remove hasSearchInput prop

See original GitHub issue

Copying from conversation with @karelhala, @jenny-s51 and @mcoker in slack:

While I was going trough the component itself I think it could be improved, I don’t think we need to include the hasSearchInput prop at all, we could allow passing custom components as consumers require, here is an example - https://codesandbox.io/s/cocky-yonath-65nuf?file=/index.js

we could provide more components to control that level, i.e. by adding a MenuInput and MenuContent container

<Menu>
  <MenuInput>
    <SearchInput />
  </MenuInput>
  <Divider>
  <MenuContent>
    <MenuList>
      <MenuListItem />
      <MenuListItem />
    </MenuList>
  </MenuContent>
</Menu>

Related: https://github.com/patternfly/patternfly-react/issues/5153

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mcokercommented, Dec 3, 2020

Technically you can, there are no styles associated with <MenuGroup> or <MenuContent>. They’re just used for sectioning.

Screen Shot 2020-12-03 at 10 36 59 AM

cc @mcarrano

0reactions
tlabajcommented, Dec 14, 2020

closed by #5211

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tile Menu - Salesforce Help
Use the Tile Menu Lightning Web component in Experience Builder to add an intuitive and visually stunning navigation experience to your site.
Read more >
Context - React
Context provides a way to pass data through the component tree without having to pass props down manually at every level. In a...
Read more >
How To Customize React Components with Props
After adding props to your component, you will use PropTypes to define the type of data you expect a component to receive.
Read more >
Work with Components and Props - Twilio Flex
Each programmable component exposes a static Content property that allows you to add to, remove or replace the component and its children.
Read more >
React Menu component - Material UI - MUI
A basic menu opens over the anchor element by default (this option can be changed via props). When close to a screen edge,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found