pull/31/head
Rich-Harris 8 years ago
parent c2daa66b3c
commit b743e54c24

@ -132,6 +132,11 @@ export default function generate ( parsed, template ) {
${name}.setAttribute( '${attribute.name}', true );
` );
}
// special case autofocus
if ( attribute.name === 'autofocus' ) {
initStatements.push( `${name}.focus();` );
}
}
else if ( attribute.value.length === 1 ) {

@ -0,0 +1,9 @@
import * as assert from 'assert';
export default {
html: '<!--#if visible-->',
test ( component, target, window ) {
component.set({ visible: true });
assert.equal( component.refs.input, window.document.activeElement );
}
};

@ -0,0 +1,3 @@
{{#if visible}}
<input ref:input autofocus>
{{/if}}
Loading…
Cancel
Save