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

Named elements Scope issue #1477

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

Comments

Projects
None yet
2 participants
@uppalapati41

uppalapati41 commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Dec 23, 2015

Member

can you make a live example please?

Member

GianlucaGuarini commented Dec 23, 2015

can you make a live example please?

@uppalapati41

This comment has been minimized.

Show comment
Hide comment
@uppalapati41

uppalapati41 Dec 23, 2015

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

uppalapati41 commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Dec 23, 2015

Member

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

Member

GianlucaGuarini commented Dec 23, 2015

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

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Dec 23, 2015

Member

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

Member

GianlucaGuarini commented Dec 23, 2015

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

@uppalapati41

This comment has been minimized.

Show comment
Hide comment
@uppalapati41

uppalapati41 Dec 23, 2015

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.

uppalapati41 commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Dec 23, 2015

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

Member

GianlucaGuarini commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@uppalapati41

uppalapati41 Dec 23, 2015

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.

uppalapati41 commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Dec 23, 2015

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 ;)

Member

GianlucaGuarini commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@uppalapati41

uppalapati41 Dec 23, 2015

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.

uppalapati41 commented Dec 23, 2015

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

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Jan 27, 2016

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

Member

GianlucaGuarini commented Jan 27, 2016

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