Skip to content

Toggle does not retain its property type when switched using buttons #658

@Aetheraeons

Description

@Aetheraeons

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.9

This Issue Occurs on

  • Windows
  • Linux
  • macOS
  • Android
  • iOS

Debug Info

SYSTEM INFO:
	Obsidian version: 1.12.7
	Installer version: 1.8.10
	Operating system: Windows 10 Enterprise 10.0.19045
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: light
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 23
	Plugins enabled: 4
		1: Meta Bind v1.4.9
		2: Dataview v0.5.68
		3: Folder notes v1.8.19
		4: Style Settings v1.0.9

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 click a button to set a toggle / set of toggles to "off", they stop being considered toggles, instead being considered a text property set to "empty" or "off".

Image

^ Before pressing button

Image

^ After pressing button; setting Null

Image

^ After pressing button; setting Off

This completely breaks the toggle, especially if there are nested values. It becomes unusable, and doesn't save after re-opening the note.

EDIT: Additional example of issue.
After checking an older note, I found the following info in properties.

Image

^ Spell slot tracker used with Toggles. Note how it has a warning.

Image

^ The displayed warning.

After clicking "update", the Property is altered:

Image

While not entirely the same, this leads me to think if maybe Meta Bind doesn't recognize nested properties properly.

Steps to Reproduce

  1. Paste code segments A or B into obsidian file

Code Segment A
INPUT[toggle:frontmatter^Test2.A]

label: "Test 2 Button"
style: primary
hidden: false
id: "TAKE-LR"
actions:
  - type: updateMetadata
    bindTarget: Test2
    evaluate: false
    value: null

Code Segment B

INPUT[toggle:frontmatter^Test2.A]

label: "Test 2 Button"
style: primary
hidden: false
id: "TAKE-LR"
actions:
  - type: updateMetadata
    bindTarget: Test2
    evaluate: false
    value: off
  1. Open file properties
  2. Click the created button
  3. Observe change in Properties field

(this sample segment was created to serve as an example for the issue; this is the same syntax / setup i'd used for other toggles).

Expected Behavior

Normally, the Checkbox property type is undefined, but retains its data in the following way:

  • Property + sub-properties are recorded as True or False, or other value options.
  • When switching the manually, the property type doesn't change, only the value.
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behavior caused by this plugin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions