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

Note contents not appearing in reading mode when note has a Meta Bind button in it #390

Closed
4 of 7 tasks
laoraryn opened this issue Jul 28, 2024 · 4 comments
Closed
4 of 7 tasks
Labels
bug Undesired behavior caused by this plugin

Comments

@laoraryn
Copy link

Please fill out these Check-boxes

  • I checked that the plugin is up to date
  • The issue persist with all other plugins and themes disabled

This Issue Occurs on

  • Windows
  • Linux
  • macOS
  • Android
  • iOS

Plugin Version

1.1.3

Describe the Issue

I'm seeing an inconsistent issue where notes with Meta Bind buttons are not displaying their content in reading mode. The text appears in edit mode, but disappears in reading mode.

It happens in some (but not all) notes I have with buttons in them, and not in notes that don't have buttons. It sometimes spontaneously starts working, but I haven't noticed a pattern. I noticed it in my daily notes, but when I copy-pasted the text from a problem note into a brand new note, the issue persisted.

I created a screen recording to show the issue - I tried to attach it here, but if that doesn't work, I can share a Google Drive link:

metabind.mp4

Steps to Reproduce

  1. Create a note with a Meta Bind button in it
  2. Switch from source mode to reading mode

I isolated the issue to the Meta Bind plugin, and disabled all other plugins, my theme, and css snippets. It still persisted. Weirdly, when I was turning on/off plugins, turning off the Excalidraw plugin could also cause the note to reappear, but it wasn't consistent. Possibly it's because it caused the active note to refresh?

I'm using Obsidian on Linux Mint 21.3 Cinnamon. It's also occurring on my phone (Google Pixel 8 Pro, Android 14), and I think it was also occurring when I was running Windows a couple weeks ago, but I can't remember for sure.

Expected Behavior

I'd expect note contents to show consistently when switching to reading mode.

@laoraryn laoraryn added the bug Undesired behavior caused by this plugin label Jul 28, 2024
@mProjectsCode
Copy link
Owner

Can you check the console for any errors?

@laoraryn
Copy link
Author

Forgot that was an option! May have found the problem - getting a 'button with id _ already exists in the button templates' error. I had been putting the button code at the bottom of each note, so I could do inline buttons above. When I found the template option in settings, I switched to that but never removed the code at the bottom of the notes.

When I remove the extra code, the notes show up consistently! So chalk this one up to user error :)

Full error from the console below:

`


plugin:obsidian-meta-bind-plugin:57
Uncaught Error: ButtonManager | button with id "thing" already exists in the button templates
at Bp.addButton (plugin:obsidian-metaind-plugin:57:18728)
at es.onMount (plugin:obsidian-metaind-plugin:57:14248)
at es.mount (plugin:obsidian-meta-bind-plugin:57:606)
at Pp.onMount (plugin:obsidian-metaind-plugin:57:16773)
at Pp.mount (plugin:obsidian-meta-bind-plugin:57:606)
at Lh.onload (plugin:obsidian-metand-plugin:111:19428)
at e.load (app.js:1:1166456)
at e.addChild (app.js:1:1166857)
at Object.addChild (app.js:1:1296415)
at Vh.wrapInMDRC (plugin:obsidian-metand-plugin:111:20078)

  addButton @ plugin:obsidian-meta-bind-plugin:57
  onMount @ plugin:obsidian-meta-bind-plugin:57
  mount @ plugin:obsidian-meta-bind-plugin:57
  onMount @ plugin:obsidian-meta-bind-plugin:57
  mount @ plugin:obsidian-meta-bind-plugin:57
  onload @ plugin:obsidian-meta-bind-plugin:111
  e.load @ app.js:1
  e.addChild @ app.js:1
  addChild @ app.js:1
  wrapInMDRC @ plugin:obsidian-meta-bind-plugin:111
  eval @ plugin:obsidian-meta-bind-plugin:133
  (anonymous) @ app.js:1
  t.postProcess @ app.js:1
  t.postProcess @ app.js:1
  h @ app.js:1
  e.onRender @ app.js:1
  requestAnimationFrame (async)    
  iu @ app.js:1
  e.queueRender @ app.js:1
  (anonymous) @ app.js:1
  r @ enhance.js:1

`

@mProjectsCode
Copy link
Owner

huh, i should catch that error and display an error message

mProjectsCode added a commit that referenced this issue Aug 4, 2024
@mProjectsCode
Copy link
Owner

this should be fixed in the newest canary release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behavior caused by this plugin
Projects
None yet
Development

No branches or pull requests

2 participants