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

Change tag type in VDom #67

Closed
remexre opened this issue Dec 31, 2017 · 6 comments · Fixed by #73
Closed

Change tag type in VDom #67

remexre opened this issue Dec 31, 2017 · 6 comments · Fixed by #73
Labels

Comments

@remexre
Copy link

remexre commented Dec 31, 2017

Could you add a method on VTag to change the tag name, e.g. from td to th?

@therustmonk
Copy link
Member

It's possible but I tried to avoid changing the tag's name, because I can't change type (tag) of the node in the DOM tree, I can replace it to the new only. Virtual node keeps the reference to the DOM's node and I'll have to add some workaround to replace the node there.

Could you describe the case where you need this feature (or send the prospective code example). Maybe I already have a solution.

@remexre
Copy link
Author

remexre commented Jan 2, 2018

In the Markdown renderer I wrote (see #60), I change td's to th's after getting a End(TableHead) event; doing it that way's a minor kludge, but then I don't need to maintain a stack of "table state info" (header or body, column number, etc.).

@remexre remexre mentioned this issue Jan 2, 2018
@therustmonk
Copy link
Member

Well... I've forgotten to fix this: https://github.com/DenisKolodin/yew/blob/4a399af0c701cd7f6a51332d3c2b03126e0db455/src/virtual_dom/vtag.rs#L207
I will do it right now! Thank you! 👍

@therustmonk
Copy link
Member

I've fixed it with #73, check, please. You can reopen this issue again if your problem still exists.

@remexre
Copy link
Author

remexre commented Jan 2, 2018

Forgive me if I'm wrong, but the tag field is still private.

@therustmonk
Copy link
Member

@remexre I made it public in #80 (you can test with that branch). Also I will try to test your repository to find a good solution for your case.

@jstarry jstarry closed this as completed Sep 27, 2019
jstarry pushed a commit to jstarry/yew that referenced this issue Jul 10, 2020
jstarry added a commit that referenced this issue Jul 10, 2020
* GitBook: [master] 2 pages modified

* Added code examples for the router docs. (#67)

* GitBook: [master] 3 pages modified

* GitBook: [master] one page modified

* Update the sample doc app to use wasm-pack (#75)

* Update the sample doc app to use wasm-pack

According to the rest of the documentation, wasm-pack and web-sys are
the recommended tool to use. However, the sample app documents the usage
of cargo-web and stdweb.

The command lines are taken from the example folder of yew.

* Some grammar fixes

* Use cargo miniserve instead of python to server the files

* Add wasm-bindgen dependency

* Fixed bad link to build script for wasm-bindgen/cargo-web (#81)

* Fixed bad link to build script for wasm-bindgen/cargo-web

* yewstack/docs#81 Updated link for cargo-web

* Update miniserve cargo install command (#88)

* create as lib right away (#93)

* updated (#92)

* GitBook: [master] 29 pages modified

* update the docs to specify that local agents do not incur serialization overhead (#89)

* Add a note telling how to bypass the recursion limit of the html! macro. (#94)

* Add a note telling how to bypass the recursion limit of the html! macro.

* Update src/concepts/html/README.md

Co-authored-by: Teymour Aldridge <[email protected]>

* Update src/concepts/html/README.md

Co-authored-by: Teymour Aldridge <[email protected]>
Co-authored-by: Justin Starry <[email protected]>

* Add latest Stack Overflow survey results (#95)

* Mention prop_or macro (#97)

* Mention prop_or macro

* Fix the prop_or vs prop_or_else mixup

* Update src/concepts/components/properties.md

Co-authored-by: Justin Starry <[email protected]>

* Fix a typo. (#102)

* Point to master branch for examples (#98)

* Point to master branch for examples

* Update src/getting-started/examples.md

Co-authored-by: Teymour Aldridge <[email protected]>

* Apply suggestions from code review

Co-authored-by: Teymour Aldridge <[email protected]>

* Update src/getting-started/examples.md

Co-authored-by: Teymour Aldridge <[email protected]>
Co-authored-by: Justin Starry <[email protected]>

* Add code of conduct to documentation as well. (#104)

* Added "" for the version at line 25 (#107)

* Added "" for the version at line 25

* Update src/getting-started/starter-templates.md

Co-authored-by: Teymour Aldridge <[email protected]>

Co-authored-by: Justin Starry <[email protected]>
Co-authored-by: Teymour Aldridge <[email protected]>

* Removed periods and fixed spelling mistakes (#103)

* Added period to description

* Fixed the spelling of " Arguabley" to "Arguably"

* Update README.md

* Added period to description

* Added period to description

* Grammar and spelling correction

added period to description, fixed spelling of "encouter" to "encounter"

* Added period to description

* Added period to description

* Grammar and spelling

Added period to description, fixed spelling of "accross" to "across"

* Added period to description

* Added period to description

* Fixed spelling of "aggresive" to "aggressive"

* Removed period from description

* Update optimizations.md

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Removed period from description

* Update src/concepts/html/README.md

Co-authored-by: Teymour Aldridge <[email protected]>

Co-authored-by: Justin Starry <[email protected]>
Co-authored-by: Teymour Aldridge <[email protected]>

* Shorten line lengths. (#106)

* Shortens line lengths (to ~100 characters max per line).
 * A few stylistic improvements
 * Corrects a couple of typos
 * Fixes a few grammar errors

Co-authored-by: Justin Starry <[email protected]>

* bumping up the yew version in Cargo.toml (#107) (#109)

* bumping up the yew version in Cargo.toml (#107)

* bumping up the yew version for stdweb

* bumping up the yew version of ConsoleService link

* bumping up the yew version

* Update src/more/debugging.md

Co-authored-by: Justin Starry <[email protected]>

* Add #[derive(Clone)] in examples (#111)

* Add #[derive(Clone)] in examples

Closes #110

* Add backticks to rust elements

Co-authored-by: Teymour Aldridge <[email protected]>

* Another backtics

Co-authored-by: Teymour Aldridge <[email protected]>

* Fix typo (#112)

* GitBook: [master] 29 pages modified

* Fix spellcheck

* Remove duplicate code of conduct

Co-authored-by: Teymour Aldridge <[email protected]>
Co-authored-by: Franck Royer <[email protected]>
Co-authored-by: Eamon Caton <[email protected]>
Co-authored-by: David Poggi <[email protected]>
Co-authored-by: Stephan Dilly <[email protected]>
Co-authored-by: 洪慈吟 <[email protected]>
Co-authored-by: Michal Kawalec <[email protected]>
Co-authored-by: codec-abc <[email protected]>
Co-authored-by: Anthony Morris <[email protected]>
Co-authored-by: Günter Zöchbauer <[email protected]>
Co-authored-by: Darren Meehan <[email protected]>
Co-authored-by: Nougator <[email protected]>
Co-authored-by: Dirk Puge <[email protected]>
Co-authored-by: hituzi no sippo <[email protected]>
Co-authored-by: Mingun <[email protected]>
Co-authored-by: FIGBERT <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants