leptos-hotkeys icon indicating copy to clipboard operation
leptos-hotkeys copied to clipboard

The argument `allow_blur_event` is a confusing boolean trap

Open mondeja opened this issue 3 months ago • 0 comments

This is a common case of a boolean trap, a software antipattern. It could be defined as a boolean trap, but at least a positive name should be expected to take action. His name is now so much confusing.

Currently, defining allow_blur_event to false in the call to provide_hotkeys_context will create a blur event on the windows object. Means something like: "if not allow blur event then create a blur event to reset all the active scopes", that doesn't makes sense.

Their name should be somehing like reset_pressed_keys_on_blur and should accept a true value to enable it.

I think that this can be implemented along with #84 and postponed to v0.3.0.

mondeja avatar Mar 25 '24 17:03 mondeja