Skip to content

Commit

Permalink
Fix toolbar button state bug (#110)
Browse files Browse the repository at this point in the history
* Fix toolbar button state bug

* bump version
  • Loading branch information
gpoitch authored Aug 10, 2022
1 parent b5eb9a4 commit a1ed52c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-mobiledoc-editor",
"version": "0.14.1",
"version": "0.14.2",
"description": "A Mobiledoc editor for React apps",
"repository": "joshfrench/react-mobiledoc-editor",
"homepage": "https://github.com/joshfrench/react-mobiledoc-editor",
Expand Down
4 changes: 2 additions & 2 deletions src/components/LinkButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ const LinkButton = ({
}
};

className = [
const currentClassName = [
className,
activeMarkupTags.indexOf('a') > -1 && activeClassName,
]
.filter(Boolean)
.join(' ');

props = { type, ...props, onClick, className };
props = { type, ...props, onClick, className: currentClassName };
return <button {...props}>{children}</button>;
}}
</ReactMobileDocContext.Consumer>
Expand Down
4 changes: 2 additions & 2 deletions src/components/MarkupButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const MarkupButton = ({
<ReactMobileDocContext.Consumer>
{({ editor, activeMarkupTags = [] }) => {
const onClick = () => editor.toggleMarkup(tag);
className = [
const currentClassName = [
className,
activeMarkupTags.indexOf(tag.toLowerCase()) > -1 && activeClassName,
]
.filter(Boolean)
.join(' ');
props = { type, ...props, onClick, className };
props = { type, ...props, onClick, className: currentClassName };
return <button {...props}>{children}</button>;
}}
</ReactMobileDocContext.Consumer>
Expand Down
4 changes: 2 additions & 2 deletions src/components/SectionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const SectionButton = ({
<ReactMobileDocContext.Consumer>
{({ editor, activeSectionTags = [] }) => {
const onClick = () => editor.toggleSection(tag);
className = [
const currentClassName = [
className,
activeSectionTags.indexOf(tag.toLowerCase()) > -1 && activeClassName,
]
.filter(Boolean)
.join(' ');
props = { type, ...props, onClick, className };
props = { type, ...props, onClick, className: currentClassName };
return <button {...props}>{children}</button>;
}}
</ReactMobileDocContext.Consumer>
Expand Down

0 comments on commit a1ed52c

Please sign in to comment.