aeonframework commented on PR #1667:
URL: https://github.com/apache/wicket/pull/1667#issuecomment-6509361541
Thanks a lot for the careful review @reiern70! All points are addressed, as
new commits on top here (no force-push), and the backport is ready.
1. **Backport to 10.x**: branch `csp-autocomplete-choicefilter-10.x` off
`wicket-10.x`, PR #1728. ChoiceFilter cherry-picked cleanly. For the
autocomplete commit: `handleSelection` uses `var` like the rest of the 10.x
file, `Gruntfile.js` runs `autocomplete.html` against jQuery 4.0.0 and 3.7.1
(no vanilla target), `autocomplete.html` loads jQuery plus
`wicket-ajax-jquery.js` only, and the `JAVASCRIPTTESTING.md` hunk is dropped.
The fix commits below are on that branch too.
2. **Version**: `@since 10.12.0` on `getChoiceData` and `@Deprecated(since =
"10.12.0", forRemoval = true)`, on both branches.
3. **Removal note**: dropped. There was none in the code or Javadoc, only in
the PR text and in the commit message of the autocomplete commit; I removed it
from the 10.x commit and updated the PR description here. `forRemoval = true`
stays; the removal is for the next major.
4. **Javadoc**: the class example now registers the listener from the
field's own `renderHead()` with an `OnDomReadyHeaderItem`, so it runs again on
every re-render, and mentions the alternative of one listener on `document`
checking `event.target` (the event bubbles). `AutoCompleteTextField` and
`AutoCompleteBehavior` now point to the event as well.
5. **Empty value**: behavior unchanged, now documented: an empty
`detail.value` leaves the input unchanged, like `preventDefault()`.
6. **eval() fallback**: done. `evalOnSelect` catches the error, logs it with
`Wicket.Log.error` and goes on with the text value, so the event is still
dispatched. New QUnit test for it (an expression that throws an `EvalError`).
7. Nits:
- (a) `getChoiceData` Javadoc now says a dashed name is read in camelCase
from `dataset` (`zip-code` becomes `dataset.zipCode`), and the class example
uses `data.zipCode`.
- (b) I kept the `bind()` in the ChoiceFilter behavior.
`enableFocusTracking` is a protected method of `AbstractFilter`, so a subclass
can override it, and the auto-submit handler should not depend on it for the
markup id. It's harmless when both run.
- (c) True, the ChoiceFilter commit has no issue of its own. Happy to
file a GitHub issue for it if you'd like one to reference, just say.
Tested on both branches: the autocomplete and filter tests in
wicket-extensions, plus the Grunt/QUnit run (jshint and qunit, both engines on
master and both jQuery versions on 10.x), all green.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]