Skip to content

Skip hover callbacks for disabled/hidden buttons - #633

Open
metif12 wants to merge 1 commit into
vlang:masterfrom
metif12:button-hover
Open

metif12 wants to merge 1 commit into
vlang:masterfrom
metif12:button-hover

Conversation

@metif12

@metif12 metif12 commented Nov 21, 2026

Copy link
Copy Markdown
Member

Follow-up to #629 (now merged).

Button.mouse_enter and Button.mouse_leave were the only input handlers without a visibility/disabled guard — they still fire on_mouse_enter / on_mouse_leave for a disabled (or hidden) button. Every other handler (btn_click, btn_key_down, btn_mouse_down, btn_mouse_up, btn_mouse_move) already returns early for that state.

Add if b.hidden || b.disabled { return } to both hover callbacks, matching the TextBox hover handlers.

1 file, +6 lines. Verified: file parses cleanly with v fmt; the remaining formatting drift is pre-existing on master.

mouse_enter and mouse_leave had no visibility or disabled guard, so a disabled button still fired on_mouse_enter/on_mouse_leave. Match the other Button handlers and the TextBox hover handlers.
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.

1 participant