[ 
https://issues.apache.org/jira/browse/WICKET-7182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18086012#comment-18086012
 ] 

ASF GitHub Bot commented on WICKET-7182:
----------------------------------------

martin-g commented on code in PR #1477:
URL: https://github.com/apache/wicket/pull/1477#discussion_r3354432226


##########
wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js:
##########
@@ -665,7 +665,7 @@
 
                                        if (document.activeElement !== input) {
                                                ignoreOneFocusGain = true;
-                                               input.trigger('focus');
+                                               jQuery(input).trigger('focus');

Review Comment:
   Better use https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
   All major browsers support it.





> Wicket Autocomplete calls event on a non jquery object
> ------------------------------------------------------
>
>                 Key: WICKET-7182
>                 URL: https://issues.apache.org/jira/browse/WICKET-7182
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 10.8.0, 10.9.0, 10.9.1
>            Reporter: Jere
>            Priority: Minor
>         Attachments: image-2026-06-04-10-49-52-107.png
>
>
> The autocomplete script tries to call "{_}element.event('focus'){_}" while 
> the element is not a jQuery wrapper element instance. The event function is a 
> jQuery function that does not exist on elements fetched through the standard 
> "{_}document.getElementByid{_}" call.
> The script does wrap the other "{_}event{_}" call with 
> "{_}jQuery(element).event('...'){_}" but on the focus branch it does not.
> !image-2026-06-04-10-49-52-107.png|width=639,height=169!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to