Skip to content

Commit

Permalink
Merge pull request smaranjitghose#784 from ashuvssut/editor-tab-fix
Browse files Browse the repository at this point in the history
bugfix: Editor editcontext is not switching
  • Loading branch information
smaranjitghose authored Mar 28, 2021
2 parents cce9e75 + 270a9e1 commit 043cec7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/pages/Editor/sections/OutputComponent/Output.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const OutputComponent = () => {
const [wordCount, setWordCount] = useState(0);

useEffect(() => {
setWordCount(pageText.split(' ').filter(c => c !== '').length);
}, [pageText])
setWordCount(pageText.split(" ").filter(c => c !== "").length);
}, [pageText]);

return (
<>
Expand All @@ -25,7 +25,7 @@ const OutputComponent = () => {
</div>
<textarea
type="text"
className={`${classes.titleInput} id-title`}
className={`${classes.titleInput}`}
onClick={editContext.isBodyHandler}
placeholder="Welcome to your Doc2Pen"
style={{
Expand All @@ -38,13 +38,14 @@ const OutputComponent = () => {
color: `${editContext.headValues.headColor}`,
width: `${editContext.headValues.headWidth}pc`,
letterSpacing: `${editContext.headValues.headLetterSpace}px`,
overflowY : 'scroll',
overflowY: "scroll",
}}
/>
<textarea
type="text"
value={editContext.bodyValues.textValue}
onChange={e => setPageText(e.target.value)}
onClick={editContext.isBodyHandler}
className={`${classes.contentInput} id-body`}
id="show-text"
placeholder="Paste your content here! You can type it too, but we know people."
Expand All @@ -58,7 +59,7 @@ const OutputComponent = () => {
color: `${editContext.bodyValues.bodyColor}`,
width: `${editContext.bodyValues.bodyWidth}pc`,
letterSpacing: `${editContext.bodyValues.bodyLetterSpace}px`,
overflowY : 'scroll',
overflowY: "scroll",
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Editor/sections/Settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Settings = () => {
value={editContext.isBody}
id="title-heading"
onClick={editContext.isBodyHandler}
className={`id-title d-none`}
className={`d-none`}
/>
<label for="title-heading" style={{ color: editContext.isBody && "#f0f7ff" }}>
Title
Expand Down

0 comments on commit 043cec7

Please sign in to comment.