Skip to content
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

The iconize element is incorrectly added to a note without icon #627

Open
Moyf opened this issue Dec 12, 2024 · 4 comments
Open

The iconize element is incorrectly added to a note without icon #627

Moyf opened this issue Dec 12, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Moyf
Copy link
Contributor

Moyf commented Dec 12, 2024

Describe the bug
As shown in the image, the iconize-inline-title-wrapper element is incorrectly added to note pages that do not have an icon.
image

This 📏 icon is actually from the other note, and it incorrectly appeared in my Daily Note.

The reason it is invisible but I care is that I want to use CSS to make the Iconize plugin work with the Pixel Banner plugin by adjusting the margin-top property to position the icon at the boundary of the banner. (Just like Notion's style)
image

However, this invisible iconize element makes the judgment more complicated.. 🤔

To Reproduce

  1. Click on some notes with icon
  2. Switch to another note without icon
  3. Open the DevTool and look into cm-sizer structure
  4. See the icon elem from previous note

Expected behavior
Remove the elem or add a .no-icon class into the elem's class?

Additional context
I noticed that this element has a display: none attribute:
image

So currently I use this css to achieve what I want:

.cm-sizer:has(.iconize-inline-title-wrapper):has(.pixel-banner-image):has(.iconize-title-icon:not([style*='display: none;'])) .iconize-inline-title-wrapper {
  margin-top: calc(-1 * var(--emoji-icon-size)) !important;
}
@Moyf
Copy link
Contributor Author

Moyf commented Dec 12, 2024

image

By the way, to avoid confusion, let me explain: the icon on my DailyNote tab is text added using the Frontmatter Title plugin, not an icon, haha.

@FlorianWoelki
Copy link
Owner

Thank you for the bug report!

There shouldn't really be an invisible icon for notes that do not have a tab icon. For instance, see the following screenshots:
image

image

@FlorianWoelki FlorianWoelki added the question Further information is requested label Dec 12, 2024
@FlorianWoelki FlorianWoelki changed the title [bug] The iconize element is incorrectly added to a note without icon The iconize element is incorrectly added to a note without icon Dec 12, 2024
@Moyf
Copy link
Contributor Author

Moyf commented Dec 13, 2024

Well that's strange.
At the moment, I am unable to reproduce the issue. 🤔

Perhaps we should close this issue for now. If I discover a way to reproduce it consistently, I can reopen it. : )

@Moyf Moyf closed this as completed Dec 13, 2024
@Moyf
Copy link
Contributor Author

Moyf commented Dec 19, 2024

bandicam.2024-12-19.16-25-16-443.mp4

I'm not certain if this is the same issue, but I coincidentally discovered that when I have multiple split tabs and add an icon in the properties, all the tabs will receive the icon (temporarily).
Refreshing the other note can restore the original state.

@Moyf Moyf reopened this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants