Comments (5)
PR on the way :)
from happy-dom.
This is the JSDOM behavior but not the default behavior. You can try to make a minimal file example like this one:
<!DOCTYPE html>
<html><body>
<input type="checkbox" />
<script type="text/javascript">
document.querySelector('input').indeterminate = true
</script>
</body></html>
And test it with chrome or firefox, with chrome it constantly make it true when clicked, and with firefox reloading the page will make it false or true changing the value on each reload.
The indeterminate state can only be set by javascript and is purely visual. It is the checked state that should determinate the new state when clicked not the indeterminate state at all.
So if your input is checked and indeterminate it should when clicked be unchecked,
if it was unchecked and indeterminate it should be checked when clicked.
from happy-dom.
There's still a problem with the happy-dom implementation, as triggering a click event on the element will not change the indeterminate state at all, but is should be passed to false.
from happy-dom.
Also I can see the actual implementation sets an attribute indeterminate on the input element but it should not as indeterminate is not meant to be an input attribute.
from happy-dom.
will propose a PR about this in few days
from happy-dom.
Related Issues (20)
- CookieContainer cache key issue HOT 1
- Implement the CompositionEvent
- `document.styleSheets` don't react to `document.adoptedStyleSheets` changes
- `preventDefault()` will not prevent navigation on a form submission
- Relaxed parsing on broken html
- broken querySelectorAll when the string contains new lines
- Range.compareBoundaryPoints should throw error
- `HTMLElement.contentEditable` should apply the `contenteditable` attribute.
- React `onClick` handler with `preventDefault()` on an anchor tag does not prevent navigation
- KeyboardEvent is missing getModifierState HOT 1
- Add support for the `AbortSignal.any()` static method
- Add support for the `AbortSignal.timeout()` static method
- `element.matches()` returns incorrect result for nested selector
- TypeError: Cannot read properties of null (reading 'toUpperCase')
- `GlobalRegistrator.register()` breaks `ServerResponse.setHeader()` in `bun`
- document.fonts.ready is undefined
- Assertions on `window.location.href` changes from react-router-dom no longer work with happy-dom 14.12.1 and above
- `GlobalRegistrator.register()` should omit the `Response` class
- Calling `new HTMLElement()` throws exception
- When running CORS check it's not sending remaining headers.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from happy-dom.