Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Edge dialog doesn't focus on edit-text anymore #407

Closed
flibbles opened this issue Sep 17, 2021 · 0 comments
Closed

Add Edge dialog doesn't focus on edit-text anymore #407

flibbles opened this issue Sep 17, 2021 · 0 comments

Comments

@flibbles
Copy link
Collaborator

In TiddlyWiki v5.1.23, when you click-dragged a new edge, the popup would have the edit-box already focused. As it should, since it has the focus="yes" attribute.

But it doesn't work anymore, which introduces the following steps into my workflow

  1. move hand to mouse
  2. move pointer to text box
  3. click
  4. move hand to keyboard

This is bullshit.

I've tried tracking this down. Tiddlywiki has pushed a change (Jermolene/TiddlyWiki5#5736). This reduces the cases when $transclude widget needs to refresh. This broke it. I stepped through the code to figure out why.

Apparently, the order of operations was: create dialog tiddler, render, attach DOM object to document.body, then slide into view. BUT THEN a "change" event would go through which would cause the dialog to rerender (because the transclude widget in gui/dialog/dialog.tid would refresh. Technically, this refresh should be superfluous since the dialog is already made, but it wasn't. That refresh is what caused the focus to work. Now that the transclude realizes it doesn't need to refresh, it doesn't work anymore.

Even though node.focus is called on that edit-text when it's created, it doesn't take. I think it's because the dialog isn't attached to document.body yet, but when I shuffle things around, it still doesn't work. I'm hoping you might have a better idea.

Either way, I've created a workaround which I'll push in a second. It's not the solution TiddlyMap needs, but it's a solution that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant