When should I use Lists vs Menus in Material-UI? - reactjs

I'm having trouble figuring out the difference between Lists and Menus in Material-UI.
Docs
Lists - https://material-ui-next.com/demos/lists/
Menus - https://material-ui-next.com/demos/menus/
Description
My thinking is that Menus are used for routing and navigation while Lists are used for configuration or static content, but then I saw these quotes:
Menus appear upon interaction with a button, action, or other control. They display a list of choices, with one choice per line.
Reading this, Menus aren't intended to always show, they're designed to be hidden and only shown temporarily.
Menus should not be used as a primary method for navigation within an app.
This makes it seem like a sidebar with a list of navigation elements should be a List. If so, what if I take the same component and want to also use it in a dropdown menu? Do I have to make a separate component using Menu components?
Question
Since the docs are unclear to me, what instances would I want to use Menus vs Lists?

These components follow the Material Design standards, so their intended use would follow the standards.
For Menu:
Menus display a list of choices on a transient sheet of material.
For List:
Lists present multiple line items vertically as a single continuous element.
So while they're similar, I think the key difference is that Menu is intended for a transient selection, presented within something like a Dialog or Modal.

Related

How to implement material-ui tabs with More dropdown (as shown in documentation screenshot)

I am looking to implement a Tabs component containing lots (7-9) Tab components for a desktop view. I do not want to use the scrollable tabs when it exceeds the viewport width on the Tabs, instead I want the extra Tab items to be in a More dropdown menu just like the example docs show below:
Questions:
What is the intended implementation to achieve this? I actually would like the exact same functionality they describe as well where when I click an item from the dropdown above (for example, books), that will swap positions with the Tab directly to the left of the More dropdown, as shown in this screenshot from the doc:
Specifically, is the More dropdown a Tab component, or a Dropdown Menu component?
When using, how does selecting a tab/option from the More Dropdown work by default? (ex: will the selected tab then get moved to the visible tab portion, just like the screenshots?). Or does this need to be done manually to achieve that result?
Lastly, are there links to any examples of this usage?
Late, but it may help someone.
I was able to achieve dropdown within tabs by using the popover component.
https://codesandbox.io/s/436906013w
It has three tabs - One, Two and Three. Clicking on Tab 'Three' will perform the normal tab change. Clicking on the dropdown arrow next to tab 'Three' will provide the additional options.
It is not an exact solution to the question but can be achieved with a similar approach.
I created logic with MUI List, u can customize it with MUI tabs.
I calculate the width al all items and check if we have enough space, if not I added more button with dropdown and added the rest inside. Be aware that now it does not recalculate if the width or length of items changed
https://codesandbox.io/s/muddy-paper-941ff?file=/src/App.js

How to use multiple ("named"?) routes at same time in a react app?

I want my react app to be build like this
On the blue left side, I have some menu buttons List A and List B that I can use to switch between the underlying lists (the blue box with the items). The list items can be clicked to view their details.
On the green right side, I want a details view to be displayed of one of the clicked blue items.
When I switch between lists on the left side, I want the details view to be unchanged and vice versa.
So for the upper image I would need to have to routes that are active simultaneously. Something like this:
http://myapp.com?route=/list_a&route=/details/a3
My app is build with React and I currently am using react-router.
Is it possible to realize something like this with react-router? Or do I need to implement this kind of routing by my own?
All I could manage is to either switch between lists OR between item details, because the used <Route .../> elements always match the a precise pattern.

How to use a select dropdown in a virtualized list?

Im currently developing a react app which has a virtualized list (https://github.com/bvaughn/react-virtualized) in it. The items in the list may contain a select dropdown.
The problem now:
The virtualized list is hiding overflow. So the last items dropdown is not displayed and you cannot scroll down to view the content of the dropdown:
================= Here is where the image ends ================
I have no idea, how I could fix this issue, without changing the virtualized list code. Anybody out there?
react-virtualized can't use overflow: visible without breaking scroll behavior (which is pretty key to how react-virtualized works). So things like drop-downs will get clipped as you've observed.
What I typically recommend for people wanting to put things like drop-down menus inside of react-virtualized rows is to use a portal. This allows the menu content to expand outside of a single row (or even the entire List) without being clipped.
I've used tajo/react-portal in the past for this.

How do I conditionally show or hide fields on a Layout in Filemaker 14 Advanced?

I'm new to creating Layouts in Filemaker (I'm not using the latest version; am using Filemaker 14 Advanced instead), and I need to know: How can I conditionally/programmatically hide and show drop-down menus on the Layout, based on a selection in another drop-down menu? For instance: Let's say I have a drop-down menu called "Race," and it has three selections: "Human, Vampire, Werewolf." If I choose "Human," I want another drop-down menu called "Class" to appear; if I choose "Vampire," I want a different drop-down menu, called "Clans," to appear instead; if I choose Werewolf, then I want a drop-down menu called "Tribes" to appear. How can I engineer this using Filemaker's built-in language, or is there some other way to do it? Step-by-step instructions and/or code, please; like I said, I'm really, really new to this and to databases in general. Thanks!
You can conditionally hide layout objects by putting a calculation in the Hide Object When blank in the Behavior section of the Data tab on the Inspector palette.
That said, there are relational ways to have your dropdowns change their contents based selections in other fields. That is a lot more flexible, but (of course) more complex. What you want to set up is called a Dynamic Value list and is based on the values in a related table, filtered by the choices you made in the previous fields.
The calculation basically boiled down to just a single "equals" statement, or a bunch of them, simply singling out the value that would need to be selected in order to hide the layout objects I wanted hidden. Thanks for the help, guys! :-)
In my case, I wanted the new dropdown menus to stay shown even if many options were chosen in the first menu. I used the Pattern Count function (https://fmhelp.filemaker.com/help/10/fmp/en/html/func_ref3.33.73.html) to specify that if the answer to the last dropdown menu contained this optioned checked, the new menu would be shown by writing the following : Not PatternCount(table::variable;"text in one of the options")

Conditional Formatting based on layout view

Another question for you Filemaker Pro experts. The database I am developing starts with a Main layout with a number of buttons (e.g. insert new item, show all items, etc.). Each button is associated to a script, which takes the user to the relevant layout. In each of these layouts I show the buttons in a row, and highlight the current layout with inverse colour.
My problem is that some of the buttons lead to the same layout, viewed in different modes, and I don't know how to conditionally highlight the right button.
For instance, Insert new item and Show all items take to the same layout, however in the first case the script views the layout as a form and inserts a new record, while in the second I view as a list and show all records. The layout is the same, though, so I'd need to enact a conditional formatting based on something. How do I do that, and what should I check against?
Thanks in advance for any help.
Regards.
Presumably you are currently using the formula: Get (LayoutName) to decide on your conditional formula, why not try additionally using formulas: Get(WindowMode) and Get(LayoutViewState)?
You could conditionally format the button if (which sends user to MyLayout in browse mode):
Get(WindowMode)=0 and Get(LayoutName)="MyLayout"
Or (which sends user to MyLayout in form view):
Get(LayoutViewState)=0 and Get(LayoutName)="MyLayout"
.
Other functions which may help could be Get(FoundCount) and Get(TotalRecordCount). You can see the entire list of Get functions here.

Resources