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

Improve focus/blur state #681

Closed
Tyriar opened this issue Jun 7, 2017 · 6 comments
Closed

Improve focus/blur state #681

Tyriar opened this issue Jun 7, 2017 · 6 comments
Assignees
Labels
type/bug Something is misbehaving
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 7, 2017

Currently clicking in the terminal will cause a blur on mousedown and a focus on mouseup (provided there is no selection). This results in the cursor showing a non-focused state even though technically the terminal is still focused and keyboard input will go to the shell.

Notice the selection and the cursor state:

image

We should put a layer in between the browser textarea blur/focus events and expose our own events, that way we can cover these mouse-related edge cases without affecting the cursor state.

@mofux
Copy link
Contributor

mofux commented Jul 11, 2017

I believe this can be closed as it seems solved by #670

@Tyriar
Copy link
Member Author

Tyriar commented Jul 11, 2017

Yeah you're right, thanks for pointing it out! 👍

@Tyriar
Copy link
Member Author

Tyriar commented Sep 2, 2017

Reopening and fixing it in my canvas_render branch. It looks like both focus and blur get triggered twice.

@Tyriar Tyriar reopened this Sep 2, 2017
@Tyriar Tyriar self-assigned this Sep 2, 2017
@Tyriar Tyriar added this to the 3.0.0 milestone Sep 2, 2017
Tyriar added a commit to Tyriar/xterm.js that referenced this issue Sep 2, 2017
@Tyriar Tyriar mentioned this issue Sep 4, 2017
22 tasks
@twifty
Copy link

twifty commented Sep 4, 2017

I'm calling Terminal.focus directly after launching a pty process. I noticed the focus was elsewhere on the page, yet a console.log(document.activeElement) after the focus call confirms the terminal was given focus.

Is there anything going on internally to cause the last focused element to regain focus?

I cannot find anything in my own code which could be doing this.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 4, 2017

@twifty might be worth creating a new issue with versions, screenshots, etc. looks like a different problem to this issue.

@twifty
Copy link

twifty commented Sep 4, 2017

@Tyriar I'd prefer to rule out my own code before making an issue of it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

3 participants