How to enforce Elm to recreate HTML tags instead of reusing existing tags?

瀏覽次數:85 次
跳到第一則未讀訊息

Kadzuya OKAMOTO

未讀,
2017年11月27日 中午12:12:462017/11/27
收件者:Elm Discuss
Here is an example app to explain this problem.
https://ellie-app.com/c5X3fGFPha1/1

In this example, a popup window flashes unexpectedly when "Tab B" is clicked.
The reason why this occurs, I guess, is bellow.

* "Tab B" is clicked
* Elm tries to reuse HTML tag (in this case the tag of the age field).
* It causes `addAttribute("aria-hidden", "true")` on the tag
* CSS transition fires because `aria-hidden` attribute was changed

To prevent this unexpected phenomenon, I'm looking for a way to prohibit Elm to reuse existing tags.
Is any workaround for this?
Or is my hypothesis above wrong?

I believe this is a usual requirement especially when we use `elm-lang/navigation` package to realize SPA routing.

Peter Damoc

未讀,
2017年11月27日 中午12:25:252017/11/27
收件者:Elm Discuss
Use Html.Keyed for managing the troublesome kids. 

Here is your example adapted based on your feedback that it is the age field that's the problem. 
https://ellie-app.com/czbx9WRyDa1/0



--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
There is NO FATE, we are the creators.
blog: http://damoc.ro/

Kadzuya OKAMOTO

未讀,
2017年11月27日 中午12:31:482017/11/27
收件者:elm-d...@googlegroups.com
This is what I wanted.
Thanks very much!

2017/11/28 午前2:25 "Peter Damoc" <pda...@gmail.com>:
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/RwYF8CAdMWA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息