mProjectsCode / mProjectsCode/obsidian-meta-bind-plugin

Input field loses focus after typing single character

Open
#569 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug wontfix
Dominant language
TypeScript
Stars
1k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Please fill out these Check-boxes
  • I checked for existing similar issues
  • I checked that the plugin is up to date
  • The issue persists with all other plugins and themes disabled
Plugin Version

1.4.1

This Issue Occurs on
  • Windows
  • Linux
  • macOS
  • Android
  • iOS
Debug Info
SYSTEM INFO:
	Obsidian version: v1.8.9
	Installer version: v1.8.9
	Operating system: #1 SMP PREEMPT_RT Sat, 08 Feb 2025 14:15:24 +0000 6.6.52-rt43-arch1-4-rt-lts
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 2
	Plugins enabled: 2
		1: Dataview v0.5.68
		2: Meta Bind v1.4.1

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
Describe the Issue

When I type text in the metabind field, the field loses focus after a single character, which prevents further typing

Steps to Reproduce
  1. Instal meta bind, dataviewjs, enable javascript inside the notes

  2. Create a note with the following content:

     ---
     exercises:
       - exercise: "[[ex1]]"
         sets:
           - weight: 3234
             reps: 3
             comment: 3ws
       - exercise: "[[ex1]]"
         sets: 
     ---
    
     ```dataviewjs
     const mb = app.plugins.getPlugin('obsidian-meta-bind-plugin').api
     const frontmatter = dv.current().file.frontmatter
     const notePath = dv.current().file.path
     frontmatter.exercises.forEach((x, i) => {
    
        const is = String(i)
        const headlineOptions = {
          renderChildType: 'inline',
          declaration: 'VIEW[{exercises['+ i +'].exercise}][text(renderMarkdown)]'
        }
    
       const tableOptions = {
         bindTarget: mb.createBindTarget('frontmatter', notePath, ['exercises', String(i), 'sets'], true),
         tableHead: ['', 'Weight', 'Reps', 'Comment'],
         columns: [
           'INPUT[toggle:scope^completed]',
           'INPUT[number(class(meta-bind-small-width),placeholder(weight)):scope^weight]',
           'INPUT[number(class(meta-bind-small-width),placeholder(reps)):scope^reps]',
           'INPUT[text(placeholder(comment)):scope^comment]',
         ],
       };
    
         console.log(i)
         console.log(x)
       const headlineContainer = document.createElement('div')
       this.container.appendChild(headlineContainer)
       const headline = mb.createViewFieldMountable(notePath, headlineOptions);
       mb.wrapInMDRC(headline, headlineContainer, this.component)
    
       const tableContainer = document.createElement('div')
       this.container.appendChild(tableContainer)
       const table = mb.createTableMountable(notePath, tableOptions)
       mb.wrapInMDRC(table, tableContainer, this.component)
     })
     ```
    
  3. Go into reading mode

  4. Try typing few characters into the field. The field loses focus after the first character preventing further typing.

Expected Behavior

When I type few consective characters into the field, the field does not lose focus after the first one and allows to enter more characters.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in Obsidian using Meta Bind 1.4.1 with the provided DataviewJS note, then inspect the generated table and text input while in reading mode. The work is complete when an input accepts consecutive characters without losing focus after the first character, while the supplied reproduction continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.