Skip to content

Fix SmallCheckboxComponent not toggling upon a left click#452

Closed
TheVoidBlock wants to merge 1 commit intowisp-forest:1.21.9from
TheVoidBlock:small-checkbox-fix
Closed

Fix SmallCheckboxComponent not toggling upon a left click#452
TheVoidBlock wants to merge 1 commit intowisp-forest:1.21.9from
TheVoidBlock:small-checkbox-fix

Conversation

@TheVoidBlock
Copy link
Copy Markdown

This pull request fixes a bug that causes the small checkbox component to not toggle when you click on it. Upon clicking the checkbox, the code checks if you left clicked with click.isLeft(). Since Click extends AbstractInput, AbstractInput.isLeft() checks if this.getKeycode() == 263. Clicks implementation of getKeycode() returns this.button(), which will be 0 if the user left-clicked, NOT 263. To fix this, I simply check if click.button() == 0.

@TheVoidBlock
Copy link
Copy Markdown
Author

Closes #444

@Noaaan
Copy link
Copy Markdown
Member

Noaaan commented Dec 2, 2025

Does this really fix this issue? The Click class is vanilla code. To me this seems more like a patch for the symptom and not the problem, which is the fact that the click event doesn't return the correct number

@Dragon-Seeker
Copy link
Copy Markdown
Member

Superseded by #463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants