Stop the autocomplete from accumulating request parameters while typing
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java, javascript
Hướng nghiên cứu
Bắt đầu tại wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js, trong prepareAndExecuteAjaxUpdate, và kiểm tra cách pre, sh và ep được sao chép trước khi các giá trị được thêm vào. Chạy StartExamples từ wicket-examples/src/test/java và mở org.apache.wicket.examples.ajax.builtin.AutoCompletePage; cấu hình một tham số bổ sung và kiểm tra công cụ dành cho nhà phát triển để xác nhận mỗi yêu cầu có một tham số truy vấn chứa nội dung nhập hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 800
- Fork
- 437
- Merge trung bình
- 21 giờ 36 phút
- Pull request đã merge (30 ngày)
- 167
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/wicket
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyCó thể đã có người làm @vaibhavgupta443 đã nhận hôm nay. Đang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/wicket#1991 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBackCó thể đã có người làm @AzizOuertani đã nhận 3 ngày trước. Đang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/wicket#1946 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/wicket
Issue tương tự
-
account assessment course feature lecture
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
app:learninggoalhub enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100