palexdev / MaterialFX

A library of material components for JavaFX
GNU Lesser General Public License v3.0
1.21k stars 122 forks source link

MFXCircleToggleNode messed clicked area [with workaround] #387

Open FelipeAumannRS opened 2 months ago

FelipeAumannRS commented 2 months ago

MFXCircleToggleNode (for some reason) have a MFXTextField which is making some trouble with the clickable area.

image That image above shows the Circle node inside the toggle node, which is the desired click area for toggleNodes. Although, the MFXCircleToggleNode actually is a set of nodes inside a vBox (probably working as a graphic's button of the toggleNode). The only issue with that is the first index of the vBox, which is a MFXTextField. This messes with mouse events, such as hovering and clicking:

MFXTextField on the StackPane, messing up with StackPane's bounds: MFXTextField on the MFXCircleToggleNode, messing up with StackPane's bounds MFXCircleToggleNode showing messed "hitbox" image

EDIT Till this isn't fixed, here's a workaround ((VBox) yourToggleNode.getChildrenUnmodifiable().getFirst()).getChildren().removeIf(node -> node.getClass().equals(MFXTextField.class)); The workaround provided above removes MFXTextField from yourToggleNode, fixing the issue.