Skip to content

Generalise what can appear as field-grid-dropdown items #2482

@microbit-matt-hillsdon

Description

@microbit-matt-hillsdon

Check for duplicates

  • I have searched for similar issues before opening a new one.

Component

field-grid-dropdown

Problem

MakeCode has a variety of grid-like dropdowns that have items that don't match what's possible with field-grid-dropdown. We're exploring whether it makes sense to switch (see microsoft/pxt-microbit#6077).

One scenario is text + images such like this:

Image

There are other uses of text + images where the styling and approach to item sizing doesn't match field-grid-dropdown. It might be possible to address those in subclasses.

Request

We'd like to explore whether it makes sense to:

  • add specific support for image + text to this plugin so we can adopt it in MakeCode (in this case we'd need to review further to be sure there were no other problematic cases)
  • alternatively, generalise this further so that the dropdown items can be supplied as DOM elements (or functions returning DOM?). It's not clear to me whether this is practical but it might be better than trying to anticipate all ways clients need to lay out an item. Would this be possible?

Alternatives considered

Without this we'd probably need to add more keyboard navigation to MakeCode rather than leveraging common code that can work across projects. See also #2481.

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions