palantir/blueprint

`createNewItemFromQuery` fired on every key press

开放

#4,510 创建于 2021年1月28日

 (6 条评论) (1 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
P2Package: selectType: bughelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (平均合并 43天 10小时) (30 天内合并 27 个 PR)

描述

Environment

  • Package version(s): @blueprintjs/core3.38.1 @blueprintjs/icons3.24.0 @blueprintjs/select3.15.3
  • Operating System: Mac OS 11.1
  • Browser name and version: Safari 14.0.2; Chrome 88.0.4324.96

Sandbox

https://stackblitz.com/edit/blueprint-select-create-new-item-bug?file=src/App.js

Steps to reproduce

  1. Open the stackblitz dev console or your web browser's console.
  2. Type anything into the suggest box.
  3. Observe that "create new tag" is called every time you type a new character.

Actual behavior

createNewItemFromQuery is being fired on every key press, and not just by (from the docs) "pressing the Enter key or by clicking on the "Create Item" option".

Expected behavior

createNewItemFromQuery should only fire when pressing the Enter key or when clicking on the "Create Item" option.

贡献者指南