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 blur as alias to focus(false) #813

Closed
jcubic opened this issue Jul 30, 2022 · 6 comments
Closed

Add blur as alias to focus(false) #813

jcubic opened this issue Jul 30, 2022 · 6 comments
Labels
feature good first issue resolved if issue is resolved, it will be open until merge with master
Milestone

Comments

@jcubic
Copy link
Owner

jcubic commented Jul 30, 2022

It may be confusing that term::blur() does nothing (it's jQuery method $.fn.blur) so there should be a blur() that is just an alias for focus(false).

Inspired by @AlexCrosby post in discussions #812

@jcubic jcubic added this to the 2.35.0 milestone Jul 30, 2022
jcubic added a commit that referenced this issue Sep 11, 2022
@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Sep 11, 2022
@kumar-rocks
Copy link

I am new to open source, can you explain more about it.

@jcubic
Copy link
Owner Author

jcubic commented Oct 1, 2022

It's implemented. I use this flow when I don't close tasks only add label resolve and close it when code is released.

@nedoder
Copy link

nedoder commented Nov 18, 2022

Is there an option to conditionally add blur option to terminal? I tried using it like this, but it always keeps terminal focused.

terminal.settings().onBlur = function () { if (document.activeElement.tagName.toLowerCase() === "input") { return true; } else { return false; } };

@jcubic
Copy link
Owner Author

jcubic commented Nov 18, 2022

Do you want to do that on initialization or when you do something like inside a command?

@nedoder
Copy link

nedoder commented Nov 18, 2022

Do you want to do that on initialization or when you do something like inside a command?

I want it to be focused at all times except when other focusable elements on the page are clicked e.g. input or textarea element, then it should switch to blur.

@jcubic
Copy link
Owner Author

jcubic commented Nov 18, 2022

I don't think you can't do this. Because of Logic. To be able to focus the input you need to blur the terminal you can't prevent something that already happened.

But anyway if you need this feature please create a new issue, this is not related to this one. This issue is about adding an alias method.

GitHub issues are not a forum where you have discussions about different topics.

@jcubic jcubic closed this as completed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

3 participants