mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
147 stars 7 forks source link

[Bug] When the cursor clicks inside the code block and then outside the code block, the entire document jumps up #48

Closed doit132 closed 4 months ago

doit132 commented 10 months ago

Animation demonstration

动画

mugiwara85 commented 10 months ago

I can't reproduce this unfortunately. Can you send me maybe a sample document?

doit132 commented 10 months ago

I can't reproduce this unfortunately. Can you send me maybe a sample document?↳

The key point is that the code block is located in the upper part of the visible area of the document.

If the code block is located in the middle or below the visible area, it will not cause jumping

image

mugiwara85 commented 10 months ago

I think that bug is coming from Obsidian. If I disable the plugin, the same behavior occurs. Can you verify that?

doit132 commented 10 months ago

I think that bug is coming from Obsidian. If I disable the plugin, the same behavior occurs. Can you verify that?↳

Yes, I just realized this, but if I close the plugin in another library, it won't jump

It may also be related to the display of property, and if set to source, there will be no bounce

image

mugiwara85 commented 10 months ago

What do you mean by "if I close the plugin in another library, it won't jump"

mugiwara85 commented 10 months ago

If I disable the plugin and set the "Properties in document" to source, I still have that jumping. Correct me if I am wrong, but this seems to me as an Obsidian bug.

doit132 commented 10 months ago

If I disable the plugin and set the "Properties in document" to source, I still have that jumping. Correct me if I am wrong, but this seems to me as an Obsidian bug.↳

If property is set to visible and plugin is turned on, there will definitely be jumping phenomenon If property is set to visible and plugin is turned off, there may not be any jumping phenomenon If property is set to source and plugin is opened, there will definitely be jumping phenomenon If property is set to source and plugin is turned off, there will be no jumping phenomenon

It's so weird, and I'm not sure what's going on

mugiwara85 commented 10 months ago

I am confused a little as well. This is with the property set to source, and plugin turned off:

https://github.com/mugiwara85/CodeblockCustomizer/assets/65603765/0c47f44b-0a2d-4f27-b4c3-16e73ec65bee

mugiwara85 commented 4 months ago

I just checked again, and this issue seems to be solved now with the current Obsidian version. Maybe it was an Obsidian bug. Could you confirm it?

mugiwara85 commented 4 months ago

no reply received

doit132 commented 4 months ago

no reply received 未收到答复

I found that this may have been caused by me modifying the font size in the code block

.cm-s-obsidian .HyperMD-codeblock {
  font-size: 0.7em;
}

Even in the latest version, if I enable the CSS style above, this phenomenon will still occur, So I turned off this style setting

mugiwara85 commented 4 months ago

That's interesting, because I could reproduce the issue, but I didn't modify the font size of the code blocks. I will look at it again.