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

Support HTMLElement#inert property #1124

Closed
mbehzad opened this issue Oct 8, 2023 · 1 comment · Fixed by #1383
Closed

Support HTMLElement#inert property #1124

mbehzad opened this issue Oct 8, 2023 · 1 comment · Fixed by #1383
Labels
enhancement New feature or request

Comments

@mbehzad
Copy link

mbehzad commented Oct 8, 2023

Hi,
according to the HTML Spec (https://html.spec.whatwg.org/multipage/interaction.html#dom-inert) the HTMLElement has the inert property which reflects its inert boolean attribute and the inert state of the DOM element (https://html.spec.whatwg.org/multipage/interaction.html#inert) (no focus, click, etc).

happy-dom seems not yet to support this. e.g.

import { Window } from 'happy-dom';

const window = new Window();
const document = window.document;
document.body.innerHTML = '<div class="container"></div>';
const container = document.querySelector('.container');

container.inert = true;

console.log(container.outerHTML); // will print `<div class="container"></div>` instead of `<div class="container" inert></div>`

cheers

@mbehzad mbehzad added the enhancement New feature or request label Oct 8, 2023
odanado added a commit to odanado/happy-dom that referenced this issue Apr 5, 2024
capricorn86 added a commit that referenced this issue Apr 5, 2024
feat: [#1124] Implement inert attribute
@capricorn86
Copy link
Owner

Thank you for reporting @mbehzad! 🙂

Big thanks to @odanado for contributing with a fix ⭐

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v14.6.0

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

Successfully merging a pull request may close this issue.

2 participants