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

Allow for removing the `id` attribute in Native.Graphics.Element.updateProps #542

Closed
rgrempel opened this Issue Mar 30, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@rgrempel
Contributor

rgrempel commented Mar 30, 2016

There is some code here ...

https://github.com/elm-lang/core/blob/3.0.0/src/Native/Graphics/Element.js#L580-L583

... which updates the id of a DOM node if the tag of an Element has changed.

Now, if the new tag is an empty string, this code will set the id of the DOM node to an empty string, which probably isn't ideal -- it would probably be better to call removeAttribute in that case to remove the id.

This would correspond better to the setProps case here ...

https://github.com/elm-lang/core/blob/3.0.0/src/Native/Graphics/Element.js#L94-L97

... since, in the setProps case, the id attribute is not created at all if it is equal to an empty string.

Now, as far as I know, the existing behaviour does not cause any practical problems. So, I'm not suggesting that it is important to change this -- I just thought I'd mention it in case it was useful at some appropriate moment.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Sorry for the slow reply. It has been busy times. All the Graphics.* modules have moved to evancz/elm-graphics so it makes sense to retarget stuff like this.

Is it possible to say this in a clearer way? Problem is not clear to me.

Member

evancz commented May 11, 2016

Sorry for the slow reply. It has been busy times. All the Graphics.* modules have moved to evancz/elm-graphics so it makes sense to retarget stuff like this.

Is it possible to say this in a clearer way? Problem is not clear to me.

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment