Skip to content

Dropdown items lazy loading #4521

Description

@ungarson

Bug Report

Steps

Use Dropdown with item content, for example:

import React from 'react'
import { Dropdown, Header } from 'semantic-ui-react'

const options = [
  {
    key: 1,
    text: 'Mobile',
    value: 1,
    content: (
      <Header icon='mobile' content='Mobile' subheader='The smallest size' />
    ),
  },
  {
    key: 2,
    text: 'Tablet',
    value: 2,
    content: (
      <Header
        icon='tablet'
        content='Tablet'
        subheader='The size in the middle'
      />
    ),
  },
  {
    key: 3,
    text: 'Desktop',
    value: 3,
    content: (
      <Header icon='desktop' content='Desktop' subheader='The largest size' />
    ),
  },
]

const DropdownExampleItemContent = () => (
  <Dropdown selection fluid options={options} placeholder='Choose an option' />
)

export default DropdownExampleItemContent

Expected Result

Header Icons would load after Dropdown is open

Actual Result

Header Icons load with Dropdown, it is a problem because sometimes we might have a lot of options and there'd be a lot of unneeded requests

Version

3.0.0-beta.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions