-
-
Notifications
You must be signed in to change notification settings - Fork 575
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
Autofocus don't work with position: fixed #324
Comments
There is enabled option which if it's set to true make terminal enabled, it do that by default but not on Android where you need to manually focus in input to have virtual keyboard open. |
With this sample code, the terminal still doesn't get a focus on loading. var consoleBlock = $('.console-block');
consoleBlock.terminal(function (command)
{
if (command !== '')
{
var result = window.eval(command);
if (result != undefined)
{
this.echo(String(result));
}
}
},
{
name: 'test',
prompt: '> ',
exit: false,
memory: true,
enabled: true
}); |
Do you have a demo somewhere because my demos are working. Also what browser/os you're using? |
I'll try to create a minimal demo. Though, if it's working for you, maybe one of the styles or code in my project interfering with jquery.terminal. |
I finally narrowed the issue down to this example: https://jsfiddle.net/txgg52fa/. |
Weird, will check it out. |
I completely don't know why it don't work, I've try to add wrapper that have position: relative inside terminal but this don't work, the only hack I've found is after you create terminal you run this:
For some reason the terminal get disabled after init, will check this later today. |
Thanks, I can use this workaround for now. Even this works: setTimeout(function() {
term.enable();
}, 0); |
Founded the issue and fixed it in devel branch (but the tests are still broken from other changes) The other solution (that will work on 1.5.0 version) is to wrap the terminal in container that will have |
note that |
Is the workaround with wrapping terminal inside a fixed container works for you? Because when I open https://jsfiddle.net/txgg52fa/1/ it doesn't seem to autofocus. |
Yes, you're right it don't work, also I was mistaken |
Thanks @jcubic. I'll just use |
The fix is in master in version 1.5.1 |
Expected behavior
It is possible to configure terminal to have focus on initialization, so there's no need to click on it.
Actual behavior
It appears like there's no easy way to achieve this.
The text was updated successfully, but these errors were encountered: