Giter Site home page Giter Site logo

Comments (3)

MarkusLeupold avatar MarkusLeupold commented on June 24, 2024

Here are two screenshots of the bug.

I chose one "Glas" of "Crepes" pressing the "G" button on my keyboard:
image

But when I click on the dropdown, I can't chose "Glas":
image

from coocook.

dboehmer avatar dboehmer commented on June 24, 2024

@MarkusLeupold Did you receive two error 500 responses because of this issues? I was warned about two 500s in the server error log.

Some quick notes:

Could this be a bug in Chromium or Bootstrap?

Currently we use jQuery .toggle() to show/hide the select options. Is that a valid way of disabling option fields?

from coocook.

MarkusLeupold avatar MarkusLeupold commented on June 24, 2024

@dboehmer When I noticed the issue, I didn't try to submit the false unit (But thinking about it now, I wonder that I did not do that. Normally I like to check out what happens in such cases).

But I remember that I actually did get one server-side error in the same Coocook session yesterday. Maybe, I already achieved to select an unavailable unit before and didn't notice the issue at that time.

I just checked out the code in dev tools:

  • There are <option> elements for all units inside the <select> element. For all units that are not available for the chosen ingredient, the <option> element simply has display: none
  • That means, that inside the DOM, all <option>s are still present
  • Regarding the set of selectable options in a select, the browser doesn't care if some <option> element is not displayed, because this only affects the element in the dropped-down list itself. The display property isn't for completely making elements unavailable in DOM—just to make them not visible.

How to solve this:

  • Only put those <option>s inside the <select>, that are actually available
  • Since there is already some code setting the <option>'s display property, this should be easily done

from coocook.

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.