palantir/blueprint

MultiSelect triggers wrapping form

Open

#4.461 aberto em 17 de dez. de 2020

Ver no GitHub
 (2 comments) (5 reactions) (0 assignees)TypeScript (2.167 forks)batch import
Form componentsP2Package: corehelp wanted

Métricas do repositório

Stars
 (20.263 stars)
Métricas de merge de PR
 (Mesclagem média 43d 10h) (27 fundiu PRs em 30d)

Description

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.

Guia do colaborador