Hi,

the problem really happens when the whole table databinding is operating :
I slowed down the whole things delaying events to occur.

I memorize focused elem (this.foc) ;

this.sequences = sequences; // this step updates the whole table and triggs 
the angular databing.

I added a 5s timeout to allow table refresh:
setTimeout(_ => {if (this.foc) { console.log("focused ",this.foc);this.foc.
nativeElement.focus();}},5000);

the whole table is nicely updated. but when the timeout occurs, the log 
displays nicely the  component.

but the focus now replies with :
ERROR TypeError: Cannot read property 'focus' of undefined

I suppose this is because the nativelement reference has been removed and 
replaced with a new one after view updates.






 

Le vendredi 5 avril 2019 15:06:36 UTC+2, Stéphane Ancelot a écrit :
>
> Hi,
>
> I have got a list of components organized in table rows.
>
> each time a row is modifed, the data are sent to the backend and returned 
> back to the application with updated fields.
>
> the view is rebuilt with these data and my focus lost.
>
> The problem is that I will have to focus again the field that was selected 
> before the view was rebuilt with the new data.
>
> Regards,
> S.Ancelot
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to