bricks/dist/docs/ja/keypress.md
yumoqing 1291f7fee3 fix: UiCode build_options uses valueField/textField fallback to 'value'/'text'
When valueField/textField are not explicitly set in opts, the auto-select
logic (line 1140) and nullable empty-option creation (lines 1144-1145) used
data[0][undefined] which returned undefined, causing:
- Single-option selects to show blank (auto-select failed)
- nullable empty options to have undefined keys

Now extracts vf/tf local variables with ||'value'/||'text' fallback at the
top of build_options(), used consistently throughout.
2026-05-29 23:03:52 +08:00

14 lines
853 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# KeyPress
**機能**:キーボードのキーイベントを監視し、ユーザーが任意のキーを押すと、現在の内容をクリアして押されたキーの名前を表示します。
**タイプ**:コンテナコントロール
**親クラス**VBox
## 初期化パラメータ
- 特別な初期化パラメータはありません。`bricks.VBox`から継承される一般的なパラメータ(レイアウト関連のオプションなど)を使用します。
## 主要なイベント
- `keydown`:グローバルなキープレスイベントにバインドされ、`key_handler` メソッドを呼び出してキー入力の処理を行います。
このイベント内で `event.key` の値を取得し、押されたキー情報を表示するテキストコントロールを動的に生成します。