Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

title attribute #97

Closed
mattiasmak opened this issue Apr 17, 2013 · 8 comments
Closed

title attribute #97

mattiasmak opened this issue Apr 17, 2013 · 8 comments
Assignees

Comments

@mattiasmak
Copy link

This might be expected behavior, but I'll report it anyway.

When using title as attribute to a component, very strange things happen. First it appears to function ok, but after 10-20 seconds the title resets to the default value. In the example below the component renders "An Event" as title at first. Then randomly it changes to "No Title".

My example markup:

<gantt-chart-event start="1365120000" end="1365984000" title="An Event"></gantt-chart-event>

Component code:

Toolkit.register(this, {
   title: 'No title'
 });
@dfreedm
Copy link
Member

dfreedm commented Apr 17, 2013

Edited to show HTML and syntax highlighting

Would you be able to show more context about this issue?
I can't seem to replicate with this fiddle: http://jsfiddle.net/dfreedm/9Mt4z/

@mattiasmak
Copy link
Author

Acually that fiddle didn't trigger the bug for me eighter... Here's the exact code that consists of two simple files. That will trigger the bug for sure.

http://cl.ly/2y152r171g2U

@sjmiles
Copy link
Contributor

sjmiles commented Apr 17, 2013

I haven't been able to reproduce this with your sample files either. Maybe just a matter of updating your repository?

We are doing a big update on [stable] today, so you may want to wait until this afternoon to update.

Fwiw, you can also use toolkit without any repository by loading 'toolkit.min.js' from here: http://toolkitchen.github.io/cdn/toolkit.min.js

Here is your example in JsBin using the above toolkit file:
http://jsbin.com/otuzus/1

It doesn't fail, but to be fair it doesn't use the 'import' either. Fwiw, I did test your exact code here with the 'import' and never saw it fail.

@sjmiles
Copy link
Contributor

sjmiles commented Apr 17, 2013

Aha, I lied, the jsbin did ultimately fail! I will look into this.

@sjmiles
Copy link
Contributor

sjmiles commented Apr 17, 2013

So, we don't 100% understand the mechanism yet, but the essential problem here is that 'title' is already a DOM attribute. So the underlying DOM objects are causing something to unexpected to happen.

When we change it to 'label' the problem goes away (at least, it hasn't failed yet).

Note that using latest 'toolkit' to can't set 'label' via attribute unless you mark it as an 'attribute'.

Iow, to do

<my-tag label="Hello"></mytag>

you need to do

<element name="my-tag" attributes="label">
...

as here: http://jsbin.com/otuzus/6/edit

@mattiasmak
Copy link
Author

Yes. I suspected it had something to do with the title itself being already used in DOM. But I felt it might be worth reporting anyways since it behaved so unexpectedly and random.

@morethanreal
Copy link
Contributor

I can no longer reproduce this. @sjmiles, was there any trick to repro other than waiting?

@sorvell
Copy link
Contributor

sorvell commented Aug 13, 2014

Closed in favor of #123

@sorvell sorvell closed this as completed Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants