Named elements Scope issue #1477

Closed
uppalapati41 opened this Issue Dec 23, 2015 · 10 comments

Projects

None yet

2 participants

@uppalapati41

Named elements are not getting pushed into tag Instance scope in dynamic cases. Here is the example
div if='{ isSelected}'
input type="text" name="inputTitle"
div
div if='{ !isSelected}'
input type="text" name="inputDesc"
div
input type='button'

Now on button click event when we try change instance of inputDesc its not available.

@GianlucaGuarini
Member

can you make a live example please?

@uppalapati41

Here am attaching example: http://plnkr.co/edit/iI9HntK7rjxYCjKVLGTZ?p=preview

Steps to reproduce:

  1. Fill the fields and click create
  2. Hover on Untitled Question and click on edit

Now I have a div which will be shown, inside that named tag am not getting instance. Tags which are outside instance is available.

Named Instance: inputQuestionTitle

@GianlucaGuarini GianlucaGuarini added bug and removed question labels Dec 23, 2015
@GianlucaGuarini
Member

I've made a more readable example here it seems that the named elements in a loop + if directive are not detected

@GianlucaGuarini
Member

no wait they are detected properly when the if condition becomes true.. http://plnkr.co/edit/miQibUSaHJIlqU1xprH7?p=preview

@uppalapati41

Correct, but in order to get instance it will be captured only on update
complete. So can there be any other work around?

On Wed, Dec 23, 2015 at 4:08 PM, Gianluca Guarini notifications@github.com
wrote:

no wait they are detected properly when the if condition becomes true..
http://plnkr.co/edit/miQibUSaHJIlqU1xprH7?p=preview


Reply to this email directly or view it on GitHub
#1477 (comment).

Thanks,
Krishna Chaitanya.

@GianlucaGuarini
Member

The current riot behavior is correct, how can riot know the named elements before they get event created in the DOM? But honestly I need to clean up your example to understand what's wrong there is too much stuff in there

@uppalapati41

My point is I have a named element under if and each which is not rendered
on DOM so what exactly I was looking for is upon edit click and change of
value in textbox and save was trying to take instance of textbox in order
to update my object that is the point where I got issue for now am using id
to get value which I feel is not correct.

On Wed, Dec 23, 2015 at 4:26 PM, Gianluca Guarini notifications@github.com
wrote:

The current riot behavior is correct, how can riot know the named elements
before they get event created in the DOM? But honestly I need to clean up
your example to understand what's wrong there is too much stuff in there


Reply to this email directly or view it on GitHub
#1477 (comment).

Thanks,
Krishna Chaitanya.

@GianlucaGuarini
Member

Ok I was able to reproduce the issue http://plnkr.co/edit/miQibUSaHJIlqU1xprH7?p=preview I will fix this bug asap @uppalapati41 thank you for reporting it ;)

@uppalapati41

Thank you!! Great library!! 👍

On Wed, Dec 23, 2015 at 4:43 PM, Gianluca Guarini notifications@github.com
wrote:

Ok I was able to reproduce the issue
http://plnkr.co/edit/miQibUSaHJIlqU1xprH7?p=preview I will fix this bug
asap @uppalapati41 https://github.com/uppalapati41 thank you for
reporting it ;)


Reply to this email directly or view it on GitHub
#1477 (comment).

Thanks,
Krishna Chaitanya.

@GianlucaGuarini
Member

this issue was fixed and the patch will be available in riot 3.0.0 we are completely refactoring the if directive http://plnkr.co/edit/Cg9LTZhJ6Ovl8ct46riJ?p=preview

@GianlucaGuarini GianlucaGuarini added this to the 3.0.0 milestone Jan 27, 2016
@GianlucaGuarini GianlucaGuarini referenced this issue Mar 19, 2016
Closed

Riot 3.0.0 roadmap #1694

14 of 16 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment