Hi Carlos,

I'm not sure we have other components with a different positioner than element, 
so you may be in new territory.  I do want it to work, so it is hopefully just 
a matter of fixing bugs.

How is are the div's missing class selectors specified?  I think UIBase 
className is only set on the element.  You may need to override that.

HTH,  I'm done for tonight.
-Ale

From: <carlos.rov...@gmail.com<mailto:carlos.rov...@gmail.com>> on behalf of 
Carlos Rovira <carlosrov...@apache.org<mailto:carlosrov...@apache.org>>
Date: Monday, October 24, 2016 at 11:04 PM
To: Alex Harui <aha...@adobe.com<mailto:aha...@adobe.com>>
Cc: "dev@flex.apache.org<mailto:dev@flex.apache.org>" 
<dev@flex.apache.org<mailto:dev@flex.apache.org>>
Subject: Re: [FlexJS] returning surrounding element in TextInput

Hi Alex,

this seems not work. I have this:

            element = input as WrappedHTMLElement;

            positioner = div as WrappedHTMLElement;
            positioner.style.position = 'relative';
            (div as WrappedHTMLElement).flexjs_wrapper = this;
            (input as WrappedHTMLElement).flexjs_wrapper = this;
            (label as WrappedHTMLElement).flexjs_wrapper = this;
            element.flexjs_wrapper = this;


In this way input change handler works, but MDL look is messed, this is the 
code generated, that is missing the first div class selectors:

<div style="position: relative;">
     <input type="text" class="mdl-textfield mdl-js-textfield mdl-textfield 
mdl-js-textfield" data-upgraded=",MaterialTextfield">
     <label class="mdl-textfield__label"></label>
</div>


2016-10-24 23:59 GMT+02:00 Alex Harui 
<aha...@adobe.com<mailto:aha...@adobe.com>>:
Try setting element as input and positioner as div.

Sent from my LG G3, an AT&T 4G LTE smartphone

------ Original message------
From: Carlos Rovira
Date: Mon, Oct 24, 2016 2:20 PM
To: dev@flex.apache.org<mailto:dev@flex.apache.org>;
Subject:[FlexJS] returning surrounding element in TextInput

Hi,

I'm subclassing TextInput (html)
I need to create a div that surrounds the input.
In html there is only input and that's the element returned.

so my question is...how should I do to return the <div> with the <input>
inside and makes the element points to the input (since the events and
handlers depends of element (the input) to do work properly

Until now I was returning the element as the surrounding div, but this end
in malfunction of change event.

Thanks.

--
Carlos Rovira
http://about.me/carlosrovira



--
Carlos Rovira
http://about.me/carlosrovira

Reply via email to