diff --git a/CHANGELOG.md b/CHANGELOG.md index f30a1198..ea9bc231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ FlatLaf Change Log ================== +## 1.6.2 + +#### Fixed bugs + +- Table: Do not select text in cell editor when it gets focus (when + `JTable.surrendersFocusOnKeystroke` is `true`) and + `TextComponent.selectAllOnFocusPolicy` is `once` (the default) or `always`. + (issue #395) + + ## 1.6.1 #### Fixed bugs diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java index 83a5aac3..4e4a2cee 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatCaret.java @@ -108,7 +108,7 @@ public class FlatCaret protected void selectAllOnFocusGained() { JTextComponent c = getComponent(); Document doc = c.getDocument(); - if( doc == null || !c.isEnabled() || !c.isEditable() ) + if( doc == null || !c.isEnabled() || !c.isEditable() || FlatUIUtils.isCellEditor( c ) ) return; Object selectAllOnFocusPolicy = c.getClientProperty( SELECT_ALL_ON_FOCUS_POLICY );