Merge pull request #6096 from harryadel/fix-autofocus

List on body for global onRendered
This commit is contained in:
Lauri Ojansivu 2026-01-24 02:54:09 +02:00 committed by GitHub
commit 537ad1eff3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,7 +3,7 @@
import { Template } from 'meteor/templating';
import { Tracker } from 'meteor/tracker';
Template.onRendered(function() {
Template.body.onRendered(function() {
Tracker.afterFlush(() => {
const el = this.find('[autofocus]');
if (el && typeof el.focus === 'function') {