Stop the autocomplete from accumulating request parameters while typing
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java, javascript
調査の方向性
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js の prepareAndExecuteAjaxUpdate から始め、値を追加する前に pre、sh、ep がどのようにコピーされるかを確認します。wicket-examples/src/test/java から StartExamples を実行し、org.apache.wicket.examples.ajax.builtin.AutoCompletePage を開きます。追加のパラメーターを設定し、開発者ツールで各リクエストに現在の入力値を持つクエリパラメーターが1つあることを確認します。
索引モデルが issue の本文から書いたものです。
説明
When an AutoCompleteTextField has extra Ajax attributes (for example a parameter added in updateAjaxAttributes), every keystroke adds another copy of the query parameter to the request. The parameter list keeps growing until the component is re-rendered, and AutoCompleteBehavior.getChoices(String) ends up receiving the first value that was typed instead of the current one.
Where
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js, function prepareAndExecuteAjaxUpdate:
const attrs = Object.assign({}, ajaxAttributes);
...
attrs.pre = attrs.pre || [];
attrs.pre.push(...);
attrs.sh = attrs.sh || [];
attrs.sh.push(successHandler);
attrs.ep = attrs.ep || [];
attrs.ep.push({'name' : cfg.parameterName, 'value' : currentInput});
Object.assign makes a shallow copy. When ajaxAttributes already has pre, sh or ep arrays, attrs points at the same arrays, and each push modifies the shared original.
Done when
- Each request carries the query parameter exactly once, with the current input, also when extra parameters are configured.
- There are no JavaScript unit tests for the autocomplete yet. Verify the fix in the browser with the autocomplete example (
wicket-examples,org.apache.wicket.examples.ajax.builtin.AutoCompletePage, started fromStartExamplesinwicket-examples/src/test/java) by adding an extra parameter and watching the requests in the developer tools. Describe what you checked in the pull request.
Background
Originally reported as WICKET-7130 (Wicket 9.18), with a quickstart attached to the Jira ticket.
Part of #1945. This issue is meant for a first contribution to Wicket. To work on it, leave a comment so others know; a claim without a pull request lapses after two weeks. Questions are welcome, here on the issue or on [email protected]. Start your branch from master, and see Send a pull request to Wicket for building and testing.
- 主要言語
- Java
- スター
- 800
- フォーク
- 437
- 平均マージ
- 21時間 36分
- マージ済み PR(30日)
- 167
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/wicket のほかの issue
-
PropertyResolver fails on JDK classes with a non-public field named like the property対応中かも @vaibhavgupta443 が今日担当しました。 オープンgood first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
apache/wicket#1991 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBack対応中かも @AzizOuertani が 3 日前に担当しました。 オープンgood first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
apache/wicket#1946 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
account assessment course feature lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
app:learninggoalhub enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100