Skip to content

[Bug]: innerText changes not reflected in DOMΒ #15603

Open
@vagasvau

Description

@vagasvau

Version

29.7.0

Steps to reproduce

When setting element.innerText, the returned value is correct, but the DOM is not updated accordingly β€” specifically, outerHTML and innerHTML do not reflect the change.

See CodeSandbox:
πŸ”— https://codesandbox.io/p/devbox/affectionate-euler-t3c9rc?workspaceId=ws_SU83iBP9rEAHoSPKtaemDj

const link = document.getElementById("link");
link.innerText = "hello world";
console.log(link.innerText); // βœ… returns "hello world"
console.log(link.outerHTML); // ❌ still shows original text, not updated

Expected behavior

console.log(link.outerHTML); // -> "hello world"

Actual behavior

console.log(link.outerHTML); // ❌ still shows original text, not updated

Additional context

No response

Environment

npmPackages
   "@babel/preset-env": "^7.22.20",
   "jest": "^29.7.0",
   "jest-environment-jsdom": "^29.7.0"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions