Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
fix select all class of text field that want to be focused, based on #44
Browse files Browse the repository at this point in the history
, #4, #65
  • Loading branch information
shahryarjb committed Mar 26, 2023
1 parent 6893967 commit 5ad4921
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 412 deletions.
12 changes: 6 additions & 6 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ Hooks.dragAndDropLocation = {
layoutDOM.classList.toggle('create-layout');
layoutDOM.classList.toggle('create-layout-pure');
});

this.handleEvent('set_focus', ({ customClasses }) => {
const formDOM = document.querySelector(`.${customClasses}`)
if (formDOM) {
formDOM.focus()
formDOM.setSelectionRange(-1, -1);
}
const formsDOM = document.querySelectorAll(`.${customClasses}`);
formsDOM.forEach((item) => {
item.focus();
item.setSelectionRange(-1, -1);
});
});
},
};
Expand Down
Loading

0 comments on commit 5ad4921

Please sign in to comment.