dboehmer / coocook

👨‍🍳🦉 Web application for collecting recipes and making food plans
https://coocook.org/
Other
11 stars 2 forks source link

Unit dropdown in Recipe View (edit view) allows selecting unavailable units with keyboard #159

Closed MarkusLeupold closed 2 years ago

MarkusLeupold commented 3 years ago

This is a bug of coocook.org

When I control the recipe edit view with my keyboard, I can choose units from the "Unit" dropdown that are not visible inside the dropped down list after clicking it.

How to recreate this bug / Exact circumstances under which the bug occured

Subjective impression of this bug

It seems like you can choose any unit of a project for any ingredient inside a recipe of this project using keyboard controls—independent from which units are actually set up to be available for this unit.

MarkusLeupold commented 3 years ago

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

dboehmer commented 3 years ago

@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?

MarkusLeupold commented 3 years ago

@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:

How to solve this: