mirror of
https://github.com/wekan/wekan.git
synced 2026-01-27 03:36:09 +01:00
Remove mquandalle:autofocus
This commit is contained in:
parent
aca661583d
commit
d8495ab08f
3 changed files with 13 additions and 2 deletions
13
client/lib/autofocus.js
Normal file
13
client/lib/autofocus.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Native replacement for mquandalle:autofocus package
|
||||
// Handles autofocus attribute in dynamically rendered Blaze templates
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
|
||||
Template.onRendered(function() {
|
||||
Tracker.afterFlush(() => {
|
||||
const el = this.find('[autofocus]');
|
||||
if (el && typeof el.focus === 'function') {
|
||||
el.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue