Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-31266: Changing items order in Relation List doesn't work on Firefox #1180

Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,15 @@
return [...relationsContainer.querySelectorAll('[type="checkbox"]')];
};
const attachRowsEventHandlers = () => {
findOrderInputs().forEach((item) => item.addEventListener('blur', updateSelectedItemsOrder, false));
findOrderInputs().forEach((item) => {
item.addEventListener('blur', updateSelectedItemsOrder, false);
item.addEventListener('change', focusOnElement, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only on FF I don't see a point to attach this event in all browsers. Please add a check if it is FF and attach it only in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the added condition only for FF attach

});
};
const focusOnElement = (event) => {
if(doc.activeElement !== event.target) {
konradoboza marked this conversation as resolved.
Show resolved Hide resolved
event.target.focus();
}
};
const emptyRelationsContainer = () => {
while (relationsContainer.lastChild) {
Expand Down