JannisX11 / blockbench

Blockbench - A low poly 3D model editor
https://www.blockbench.net
GNU General Public License v3.0
3.06k stars 272 forks source link

[Technical Bug] Amend checkboxes are always checked initially #2231

Closed Malik12tree closed 1 month ago

Malik12tree commented 3 months ago

What are you trying to do, and what do you expect to happen?

Code

Undo.amendEdit(
  {
    reverse: { type: "checkbox", label: "Reverse", value: false },
    ...
  },
  ...
);

Expected Initial Result

image

What happens instead?

Actual Result

image

Possible Cause

HTML treats a checkbox as "checked" when the checked attribute is present regarding the value. Thus, checked="false" is identical to checked="true" identical to checked="foobar"

image

Model format in which the issue occurs

N/A

Blockbench variant

Website, PWA, Program

Blockbench version

4.9.4

Operating System

Unrelated

Installed Blockbench plugins

No response