Ah, sorry. I'm not sure what I was thinking. TextArea is like input, the
DOM storage values don't change when the input value changes. IOW, you can
observe it's value with MutationObserver.

You need to listen to the value of the textarea.value changing. You can do
that either by listening to the 'value' event or by observing the value of
this.post in the blog post element.


On Fri, Apr 4, 2014 at 7:10 AM, Rob Dodson <[email protected]> wrote:

> Hm, still no luck observing characterData. Here's a jsbin:
> http://jsbin.com/jidiyexi/2/edit
>
>
> On Fri, Apr 4, 2014 at 5:05 AM, Rafael Weinstein <[email protected]>wrote:
>
>> i think you probably want to observe the characterData of the text-area,
>> not the attribute.
>>
>>
>> On Thu, Apr 3, 2014 at 11:24 PM, Rob Dodson <[email protected]> wrote:
>>
>>> Moved to stackoverflow:
>>> http://stackoverflow.com/questions/22855083/accessing-an-attribute-on-a-child-thats-set-with-a-data-binding
>>>
>>>
>>> On Thursday, April 3, 2014 11:21:29 PM UTC-7, Rob Dodson wrote:
>>>>
>>>> I have a little bit of markup that looks like this:
>>>>
>>>> <polymer-element name="blog-post" noscript>
>>>>       <template>
>>>>
>>>>         <mark-down>
>>>>           <textarea value="{{post}}"></textarea>
>>>>         </mark-down>
>>>>
>>>>         <polymer-localstorage name="my-blog-editor" value="{{post}}">
>>>>         </polymer-localstorage>
>>>>       </template>
>>>> </polymer-element>
>>>>
>>>> I'd like the mark-down tag to be able to see the value of the textarea
>>>> but I'm having a hard time knowing when to query for it.
>>>>
>>>> Inside of mark-down my code looks something like this:
>>>>
>>>>       attached: function() {
>>>>           this.textarea = this.$.textareaContent.getDistributedNodes()[0];
>>>>  // this grabs the textarea element
>>>>
>>>>           // create an observer instance
>>>>           var observer = new MutationObserver(function(mutations) {
>>>>             mutations.forEach(function(mutation) {
>>>>               console.log(mutation);
>>>>             });
>>>>           });
>>>>
>>>>           // pass in the target node, as well as the observer options
>>>>           observer.observe(this.textarea, { attributes: true });
>>>>       }
>>>>
>>>> Unfortunately the mutation observer never fires. I've tried checking
>>>> for the value of textarea directly in attached and domReady but it's always
>>>> null. The only success I've had is to use a setTimeout to check for the
>>>> value asynchronously.
>>>>
>>>  Follow Polymer on Google+: plus.google.com/107187849809354688692
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Polymer" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/polymer-dev/6d343f4a-b8fd-43df-8c18-d62072bcbc34%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/6d343f4a-b8fd-43df-8c18-d62072bcbc34%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CABMdHiQPcYHz_ovEHzDn1KoaOSUGvfxRDEgZhAP3aRenc-mSXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to