bbovenzi commented on code in PR #40744:
URL: https://github.com/apache/airflow/pull/40744#discussion_r1827771178


##########
airflow/www/static/js/dags.js:
##########
@@ -116,21 +116,27 @@ $.each($("[id^=toggle]"), function toggleId() {
   });
 });
 
-$(".typeahead").typeahead({
-  source(query, callback) {
-    return $.ajax(autocompleteUrl, {
+// eslint-disable-next-line no-underscore-dangle

Review Comment:
   ```suggestion
   ```
   
   Not needed anymore



##########
airflow/www/static/js/dags.js:
##########
@@ -116,21 +116,27 @@ $.each($("[id^=toggle]"), function toggleId() {
   });
 });
 
-$(".typeahead").typeahead({
-  source(query, callback) {
-    return $.ajax(autocompleteUrl, {
+// eslint-disable-next-line no-underscore-dangle
+$(".typeahead").autocomplete({
+  autoFocus:true,
+  source: (request, response)=> {
+    $.ajax({
+      url: autocompleteUrl,
       data: {
-        query: encodeURIComponent(query),
+        query: encodeURIComponent(request.term),
         status: statusFilter,
       },
-      success: callback,
+      success: (data)=> {
+        response(data);
+      }
     });
   },
-  displayText(value) {
-    return value.dag_display_name || value.name;
+  focus: (event, ui)=> {

Review Comment:
   ```suggestion
     focus: (event)=> {
   ```



-- 
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]

Reply via email to