mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 13:01:03 +00:00
[Bugfix] Fix references to element.id (#1563)
Fix references to element.id
This commit is contained in:
parent
91d06309dc
commit
a29403f4b7
11
src/htmx.js
11
src/htmx.js
@ -760,7 +760,7 @@ return (function () {
|
||||
* @returns
|
||||
*/
|
||||
function oobSwap(oobValue, oobElement, settleInfo) {
|
||||
var selector = "#" + oobElement.id;
|
||||
var selector = "#" + getRawAttribute(oobElement, "id");
|
||||
var swapStyle = "outerHTML";
|
||||
if (oobValue === "true") {
|
||||
// do nothing
|
||||
@ -841,8 +841,9 @@ return (function () {
|
||||
|
||||
function handleAttributes(parentNode, fragment, settleInfo) {
|
||||
forEach(fragment.querySelectorAll("[id]"), function (newNode) {
|
||||
if (newNode.id && newNode.id.length > 0) {
|
||||
var normalizedId = newNode.id.replace("'", "\\'");
|
||||
var id = getRawAttribute(newNode, "id")
|
||||
if (id && id.length > 0) {
|
||||
var normalizedId = id.replace("'", "\\'");
|
||||
var normalizedTag = newNode.tagName.replace(':', '\\:');
|
||||
var oldNode = parentNode.querySelector(normalizedTag + "[id='" + normalizedId + "']");
|
||||
if (oldNode && oldNode !== parentNode) {
|
||||
@ -3354,8 +3355,8 @@ return (function () {
|
||||
|
||||
if (selectionInfo.elt &&
|
||||
!bodyContains(selectionInfo.elt) &&
|
||||
selectionInfo.elt.id) {
|
||||
var newActiveElt = document.getElementById(selectionInfo.elt.id);
|
||||
getRawAttribute(selectionInfo.elt, "id")) {
|
||||
var newActiveElt = document.getElementById(getRawAttribute(selectionInfo.elt, "id"));
|
||||
var focusOptions = { preventScroll: swapSpec.focusScroll !== undefined ? !swapSpec.focusScroll : !htmx.config.defaultFocusScroll };
|
||||
if (newActiveElt) {
|
||||
// @ts-ignore
|
||||
|
Loading…
x
Reference in New Issue
Block a user