From 68d0f0c36ba4cbe84272b1b970d4c8bcfd8ec750 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Wed, 19 Feb 2020 19:43:20 -0800 Subject: [PATCH] fix selection style logic Closes #950 --- components/Carbon.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/Carbon.js b/components/Carbon.js index a337902..764e7bb 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -113,10 +113,11 @@ class Carbon extends React.PureComponent { onSelectionChange = changes => { if (this.state.selectionAt) { const css = [ - changes.bold && `font-weight: ${changes.bold ? 'bold' : 'initial'}`, - changes.italics && `font-style: ${changes.italics ? 'italic' : 'initial'}`, - changes.underline && `text-decoration: ${changes.underline ? 'underline' : 'initial'}`, - changes.color && `color: ${changes.color} !important` + changes.bold != null && `font-weight: ${changes.bold ? 'bold' : 'initial'}`, + changes.italics != null && `font-style: ${changes.italics ? 'italic' : 'initial'}`, + changes.underline != null && + `text-decoration: ${changes.underline ? 'underline' : 'initial'}`, + changes.color != null && `color: ${changes.color} !important` ] .filter(Boolean) .join('; ')