-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Fixes #10025: Toggle external editing button overlaps with bold button. #10069
Changes from 1 commit
76fb468
62085ad
361e6d0
6d60843
d779ce5
c8112d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ import { NoteBodyEditorProps } from '../../../utils/types'; | |||||
const { buildStyle } = require('@joplin/lib/theme'); | ||||||
|
||||||
export default function styles(props: NoteBodyEditorProps) { | ||||||
const leftExtraToolbarContainerWidth = props.watchedNoteFiles.length > 0 ? 120 : 80; | ||||||
return buildStyle(['TinyMCE', props.style.width, props.style.height], props.themeId, (theme: any) => { | ||||||
const extraToolbarContainer = { | ||||||
boxSizing: 'content-box', | ||||||
|
@@ -38,7 +39,7 @@ export default function styles(props: NoteBodyEditorProps) { | |||||
}, | ||||||
leftExtraToolbarContainer: { | ||||||
...extraToolbarContainer, | ||||||
width: 80, | ||||||
width: { leftExtraToolbarContainerWidth }, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Including the
Setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, when we directly update leftExtraToolbarContainerWidth (width: leftExtraToolbarContainerWidth), it's only setting the value once and not updating the width when watchedNoteFiles changes. I've tried logging the value of leftExtraToolbarContainerWidth, which shows correctly. However, the problem is that the width of the container is not updating during changes in watchedNoteFiles. I've tried to figure it out, and I believe the issue is that the styles are initially loaded and not updating during changes in watchedNoteFiles There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It should be possible to fix this by updating the dependency array ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for pointing that out.I wasn't aware of the ( |
||||||
left: 0, | ||||||
}, | ||||||
rightExtraToolbarContainer: { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, this always increases the size reserved for the toolbar button. Based on comment, I think it would make more sense to change the size conditionally. (This might require adding a dependency to the
useEffect
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screencast.from.07-03-24.12.47.12.PM.IST.webm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updated video! (I had been looking at the video attached under "After" in the PR description :) )