radekkozak / discordian

Obsidian dark theme inspired by Discord
MIT License
105 stars 4 forks source link

Cannot edit when using Discordian Theme #35

Closed joshdoyle closed 3 years ago

joshdoyle commented 3 years ago

After switching to Discordian Theme I cannot edit the note. It acts like it is in preview mode but it isn't. I can edit once I switch to another theme.

radekkozak commented 3 years ago

Hi Josh, that is quite disturbing i must say, but i cannot imagine this is somehow related to the theme itself, even as you say when switching themes. It looks more like sth with cache or so. I don't think any theme can interact with Obsidian's Edit & Preview mode in such way as to disable editing altogether

Either way i would like to see what's really happening there in your setting. Can you provide more details or ideally send me your vault (minus the notes of course) so i could debug.

Also what version of Obsidian & theme are you currently. And are you on Windows or OSX ?

By the way: after switching themes - did you try to reload (ctrl+r) or simply close/open (restart) Obsidian just to be sure it's clean start. I'm guessing Obsidian might do something weird so sometimes this is the simplest solution.

Let me know, because you are quite frankly first with such problem /cc @joshdoyle

radekkozak commented 3 years ago

Also it would be quite helpful if you provide me console report - i wonder if there are some errors there (they might be coming from any kind of plugin you use for example which in consequence might interfere with Obsidian's rendering the note in Edit/Preview mode)

you can do that via Obsidian->View->Toggle Developer Tools

radekkozak commented 3 years ago

There was a similar bug somewhere back reported in Obsidian itself https://forum.obsidian.md/t/cannot-switch-to-edit-mode-with-certain-notes/3639

Maybe the issue reverted back with newest version or something. Just letting you know

radekkozak commented 3 years ago

Hi again Josh - i was wondering: do you still have the issue ? I would like to close this if there is no follow-up from you and the problem was indeed Obsidian rendering as i suspected. If not let me know

/cc @joshdoyle

louy commented 3 years ago

I have the same issue. I have identified it to be the CodeMirror-vscrollbar element having a 100% width for some reason in the markdown editor pane. Doesn't happen in preview mode but only in editor mode when the content is large enough to prompt a scrollbar

louy commented 3 years ago

I can confirm it happens with Discordian theme with no plugins installed. Removing the element from the DOM fixes the issue.

Basically the scrollbar covers the entire text area so the text becomes un-clickable

I'm using Obsidian on macOS

louy commented 3 years ago

Note that the width: 100% style is inline

Screenshot 2021-03-17 at 13 12 10

Removing the width attribute solves the problem

louy commented 3 years ago

Actually nevermind the issue is the z-index of the scrollbar element, not the width

Removing this rule solves the problem for me

https://github.com/radekkozak/discordian/blob/13c346611d9b8f584061e97828bea93d99111410/.theme/wysiwyg.css#L94-L99

radekkozak commented 3 years ago

Hi Louay, thanks for the contribution. Z-index wasn't my first choice to be honest, it was the only quick solution to accommodate Obsidian's mod-cm5 which broke pseudo-wysiwyg (it did shift few things between Editor and Preview mode)

Weird enough z-index does not break editability for me (i'm on macOS also) but i'm gonna merge proposed changes - i rely on your reproducability of the issue - i think it's more important to not break anything than some width shifts between modes

Thanks again for the contrib mate, appreciated /cc @louy