Repository: sshahine/JFoenix (language: java)

Issue:
JFXCheckBox label overflows instead of using ellipsis
How to reproduce:

- Add JFXCheckBox to a container with a long label
- Resize container to a length shorter than the label
- Label will not be shorten and will overflow instead

This differs from the standard CheckBox as it properly uses ellipsis to shorten its label.


Discussion / hints:

Fix patch:
diff --git a/jfoenix/src/main/java/com/jfoenix/skins/JFXCheckBoxSkin.java b/jfoenix/src/main/java/com/jfoenix/skins/JFXCheckBoxSkin.java
index c46ce199..3ce5c001 100644
--- a/jfoenix/src/main/java/com/jfoenix/skins/JFXCheckBoxSkin.java
+++ b/jfoenix/src/main/java/com/jfoenix/skins/JFXCheckBoxSkin.java
@@ -175,7 +175,7 @@ protected void updateChildren() {
 
     @Override
     protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
-        return super.computePrefWidth(height, topInset, rightInset, bottomInset, leftInset)
+        return super.computeMinWidth(height, topInset, rightInset, bottomInset, leftInset)
                + snapSize(box.minWidth(-1)) + getLabelOffset();
     }
 


Test patch: