palantir/blueprint

MultiSelect triggers wrapping form

開放

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

 (2 則留言) (5 個反應) (0 位負責人)TypeScript (2,167 個分叉)batch import
Form componentsP2Package: corehelp wanted

倉庫指標

星標
 (20,263 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南