Skip to content

Accessing internal state of CP from command handlers. #39

@rouilj

Description

@rouilj

I am looking at implementing a formatting function for a text area to be triggered from
command pal. To do this, being able to see what control was focused when command-pal
was invoked would be valuable.

Obviously I can't find that when command-pal is active as focus is in the search input.
In pull #33 I set focusedElement to store that data when command-pal is activated by
hotkey or button click.

It would be nice to access that from c.focusedElement (c=CommandPal(...)) or something.
Any ideas on how to do this cleanly?

I did manage to add a new displayPalette() method on #28. But the implementation feels hacky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions