Merge pull request #6088 from harryadel/autofocus-migration

Remove mquandalle:autofocus
This commit is contained in:
Lauri Ojansivu 2026-01-24 02:04:21 +02:00 committed by GitHub
commit ff9f29d12d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View file

@ -42,7 +42,6 @@ session@1.2.1
tracker@1.3.3
underscore@1.0.13
audit-argument-checks@1.0.7
mquandalle:autofocus
raix:handlebar-helpers
http@2.0.0! # force new http package

View file

@ -78,7 +78,6 @@ mongo-decimal@0.1.3
mongo-dev-server@1.1.0
mongo-id@1.0.8
mongo-livedata@1.0.12
mquandalle:autofocus@1.0.0
mquandalle:jade@0.4.9
mquandalle:jade-compiler@0.4.5
msavin:usercache@1.8.0

13
client/lib/autofocus.js Normal file
View 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();
}
});
});