Open ady-ghe opened 4 years ago
This seems to be open for 4 months. Is someone looking into this issue? This is creating a lot of other issues.
Not ideal, but did a workaround for this, with the `activate´ event of the table. Something like:
<ngx-datatable [rows]="rows" class="bootstrap"
(activate)="onActivate($event)"
...
onActivate(event) {
if (event.type = 'dblclick' && event.cellElement) {
const input: HTMLInputElement = event.cellElement.childNodes[0].children[0] as HTMLInputElement;
input.focus();
// input.select();
}
}
Reference for focus
: https://stackoverflow.com/a/51324147/643416
autofocus
is only applied once on page load. For auto focusing components that are shown/hidden, an explicit focus()
call is required
The autofocus content attribute allows the author to indicate that a control is to be focused as soon as the page is loaded or as soon as the dialog within which it finds itself is shown, allowing the user to just start typing without having to manually focus the main control.
I already tried creating an autofocus
directive and it works for both input field and select. Does anyone have any concerns about this approach?
I'm submitting a ... (check one with "x")
Current behavior
I double clicked on a field, the edit inline appears but the autofocus isn't working, even if the "autofocus" attribute is there. You have to click again on the input to start editing value.
Expected behavior
After doubleclick, the inline input field should have the focus on, so you don't have to click again.
Reproduction of the problem
just use your online demo: https://swimlane.github.io/ngx-datatable/#inline-edit
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
latest Google Chrome on Windows 10
Table version:
17.0.0.
Angular version:
your online demo setup.
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Chrome
Language: [all | TypeScript X.X | ES6/7 | ES5]