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

Focused element deleted by morph #55

Open
pdf opened this issue May 12, 2024 · 0 comments
Open

Focused element deleted by morph #55

pdf opened this issue May 12, 2024 · 0 comments

Comments

@pdf
Copy link

pdf commented May 12, 2024

I'm using htmx and am looking for more granular DOM updates. After installing the htmx extension from this project and enabling it via hx-swap="morph" on the relevant element, the morph occurs however the currently focused element is completely deleted from the DOM.

This happens regularly when a child input element value change triggers a swap of the parent, since the input will always be focused during the swap.

If I specify hx-swap="morph:{ignoreActive:true}" this behaviour is avoided, but that seems like a hack, and (IIUC) will ignore changes to the active element that sent by the server, which is undesirable in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant