Skip to content

Dropdown(onSelect) of elementalui seems broken #98

Open
@bijancn

Description

@bijancn

The case class

case class Dropdown(alignRight: js.UndefOr[Boolean] = js.undefined,
                    buttonHasDisclosureArrow: js.UndefOr[Boolean] = js.undefined,
                    buttonLabel: js.UndefOr[String] = js.undefined,
                    buttonType: js.UndefOr[ButtonType] = js.undefined,
                    className: js.UndefOr[String] = js.undefined,
                    isOpen: js.UndefOr[Boolean] = js.undefined,
                    children: js.UndefOr[Boolean] = js.undefined,
                    items: js.Array[DropdownMenuItem],
                    onSelect: js.UndefOr[ReactEventFromHtml => Callback] = js.undefined)

offers an onSelect option and I would have expected that it works similar to the onChange of FormInput or the onChange of FormSelect, i.e. I can put a handler in there to change my state of items. However, if I add a handler I see that

    private def handler: ReactEventFromHtml => Callback = event => {
      println(s"event = ${event}"); submit(event)
    }

gives

event = undefined

so I have a hard time using that. I only can see in react dropdown examples that people are using onClick and not onSelect (like here e.g. reactstrap/reactstrap#559). Is this maybe just the wrong attribute?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions