Skip to content

Commit a1ed52c

Browse files
authored
Fix toolbar button state bug (#110)
* Fix toolbar button state bug * bump version
1 parent b5eb9a4 commit a1ed52c

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-mobiledoc-editor",
3-
"version": "0.14.1",
3+
"version": "0.14.2",
44
"description": "A Mobiledoc editor for React apps",
55
"repository": "joshfrench/react-mobiledoc-editor",
66
"homepage": "https://github.com/joshfrench/react-mobiledoc-editor",

src/components/LinkButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ const LinkButton = ({
2626
}
2727
};
2828

29-
className = [
29+
const currentClassName = [
3030
className,
3131
activeMarkupTags.indexOf('a') > -1 && activeClassName,
3232
]
3333
.filter(Boolean)
3434
.join(' ');
3535

36-
props = { type, ...props, onClick, className };
36+
props = { type, ...props, onClick, className: currentClassName };
3737
return <button {...props}>{children}</button>;
3838
}}
3939
</ReactMobileDocContext.Consumer>

src/components/MarkupButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const MarkupButton = ({
1515
<ReactMobileDocContext.Consumer>
1616
{({ editor, activeMarkupTags = [] }) => {
1717
const onClick = () => editor.toggleMarkup(tag);
18-
className = [
18+
const currentClassName = [
1919
className,
2020
activeMarkupTags.indexOf(tag.toLowerCase()) > -1 && activeClassName,
2121
]
2222
.filter(Boolean)
2323
.join(' ');
24-
props = { type, ...props, onClick, className };
24+
props = { type, ...props, onClick, className: currentClassName };
2525
return <button {...props}>{children}</button>;
2626
}}
2727
</ReactMobileDocContext.Consumer>

src/components/SectionButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const SectionButton = ({
1515
<ReactMobileDocContext.Consumer>
1616
{({ editor, activeSectionTags = [] }) => {
1717
const onClick = () => editor.toggleSection(tag);
18-
className = [
18+
const currentClassName = [
1919
className,
2020
activeSectionTags.indexOf(tag.toLowerCase()) > -1 && activeClassName,
2121
]
2222
.filter(Boolean)
2323
.join(' ');
24-
props = { type, ...props, onClick, className };
24+
props = { type, ...props, onClick, className: currentClassName };
2525
return <button {...props}>{children}</button>;
2626
}}
2727
</ReactMobileDocContext.Consumer>

0 commit comments

Comments
 (0)