Added Search function for items and fixed javascript controller
This commit is contained in:
11
app/javascript/controllers/search_form_controller.js
Normal file
11
app/javascript/controllers/search_form_controller.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Controller } from "@hotwired/stimulus";
|
||||
|
||||
export default class extends Controller {
|
||||
submit() {
|
||||
clearTimeout(this.timeout);
|
||||
// Wartet 200ms nach dem letzten Tastendruck, bevor gesucht wird
|
||||
this.timeout = setTimeout(() => {
|
||||
this.element.requestSubmit();
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user