palantir/blueprint

MultiSelect triggers wrapping form

Open

#4,461 建立於 2020年12月17日

在 GitHub 查看
 (2 留言) (5 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
Form componentsP2Package: corehelp wanted

描述

Environment

  • Package version(s): select 3.15.0
  • Operating System: Docker / node 14
  • Browser name and version: Chrome latest

Code Sandbox

Link to a minimal repro (fork this code sandbox): https://codesandbox.io/s/blueprint-sandbox-forked-cnc83?file=/src/index.tsx

Steps to reproduce

  1. Create a MultiSelect
  2. Place it inside a form
  3. Select a value, confirm with enter

Actual behavior

The form is submitted.

Expected behavior

The value is added to the tag list and the form remains un-submitted.

Possible solution

Doing event.stopPropagation and event.preventDefault in the onItemSelect handler does not help. Same with overriding tagInputProps.onChange.

貢獻者指南