Giter VIP home page Giter VIP logo

Comments (5)

malko avatar malko commented on July 18, 2024 1

PR on the way :)

from happy-dom.

malko avatar malko commented on July 18, 2024

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.

malko avatar malko commented on July 18, 2024

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.

malko avatar malko commented on July 18, 2024

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.

malko avatar malko commented on July 18, 2024

will propose a PR about this in few days

from happy-dom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.