Pass clicks through to interactive elements in LP mode#380
Merged
Conversation
In Live Preview, clicking an admonition moves the cursor to its source. This intercepted clicks on interactive child elements (Meta Bind inputs, dropdowns, checkboxes), making those plugins unusable inside admonitions. Now checks whether the click target is an interactive element (input, button, select, label, tabindex, etc.) before jumping to source — matching the behavior of native Obsidian callouts. Fixes #361 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
src/main.ts: Modified click handler to pass through clicks on interactive elements (inputs, buttons, selects, links, etc.) instead of always moving the editor cursor. This allows Meta Bind inputs and other interactive elements inside admonitions to work properly in Live Preview mode.
ad-test-vault/10-metabind.md: Added comprehensive test document demonstrating Meta Bind input compatibility with admonitions, including toggles, dropdowns, and text inputs in both
ad-*blocks and native callouts.ad-test-vault/00-index.md: Added reference to new Meta Bind test document.
Behavior
Clicks on interactive elements within admonitions are now passed through to the element itself, while clicks on non-interactive areas still move the editor cursor to the admonition source (matching native Obsidian callout behavior).