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.

SelectDropdown: Add Component

See original GitHub issue

For integration with Gutenberg, we may need to replace the current FontSizePicker component from @wordpress/components (as it related to Typography Tools in Global Styles).

As such, we’ll need some sort of custom select component:

Screen Shot 2020-11-23 at 2 11 07 PM

I’m not a fan of the name CustomSelect (from @wordpress/components). Ultimately, we can go with that if it’s the best option.

I feel like either SelectDropdown or SelectMenu is a better description.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
diegohazcommented, Dec 11, 2020

From your perspective, should we use Menu or Combobox? 😃.

A bit late here! 😅

That’s a great question. I’ve seen people using Menu for that in the past: https://codesandbox.io/s/gaudi-0bp08?file=/src/components/Listbox/Listbox.tsx

But I think Combobox is the best base for that, although it would still require a lot of work to make a select completely accessible with that.

Anyway, the best resources I know for accessible select components are these articles by Sarah Higley:

0reactions
ItsJonQcommented, Nov 24, 2020

Update: We did it! ✨

In addition to reusing 99% of existing components and styles for SelectDropdown, I also have Portaling + Popper working.

Check out this demo: https://d.pr/v/RIRg1p

In it, you can see the Dropdown repositioning itself to the left/right if there’s a chance it may be “cut off” from view in the browser (this is thanks to the positioning engine that is popper.js). The content is also Portal’ed. So it doesn’t absorb lineHeight/fontSize styles from the inline text content.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create a Dropdown select component in React?
Step 1: Analyze the dropdown component · Step 2: Create a dropdown input UI · Step 3: Create a dropdown menu UI ·...
Read more >
How to add a new item in a drop down list of select component ...
I have a dropdown component that uses the Select component from react-select dependency. I have added a button in the dropdown's option list ......
Read more >
Customize a reusable React dropdown menu component
A dropdown component, which is a custom version of the dropdown select option with extended styles, sorts and filters content on webpages.
Read more >
react-dropdown-select - npm
Start using react-dropdown-select in your project by running `npm i ... If create set to true, this will be the label of the...
Read more >
Components - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
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