Surface render events in famo.us

前端 未结 3 860
名媛妹妹
名媛妹妹 2021-01-15 06:06

I\'m looking for an event that tells me when a surface has been rendered so I can call methods like surface.focus().

If I call focus immediately after I create the s

3条回答
  •  灰色年华
    2021-01-15 06:57

    I know this has been answered already, all be it a few months ago. I just thought that I would add that currently you can do this without subclassing as follows:

    var textbox = new InputSurface({
        size: [true,true],
        placeholder: 'Text'
    });
    
    textbox.on('deploy', function() {
        textbox.focus();
    });
    

提交回复
热议问题