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

Handle [type] attribute on the Button element #1033

Merged
merged 10 commits into from
May 26, 2020

Conversation

captain-yossarian
Copy link
Contributor

@captain-yossarian captain-yossarian commented Mar 14, 2020

Relates to #750
Fixes: #1252

@captain-yossarian
Copy link
Contributor Author

captain-yossarian commented Mar 14, 2020

@jstarry If/when this PR will be approved we can merge these changes.
I've tested simple yew app with stdweb cganges and it worked as expected

@jstarry
Copy link
Member

jstarry commented Apr 25, 2020

@captain-yossarian I think it's unlikely that stdweb will update. Do you mind implementing this for web-sys only for now?

@captain-yossarian
Copy link
Contributor Author

Sure, I will do it at the weekend

// TODO: add std_web after https://github.com/koute/stdweb/issues/395 will be approved
// Check this out: https://github.com/yewstack/yew/pull/1033/commits/4b4e958bb1ccac0524eb20f63f06ae394c20553d
cfg_match! {
feature = "web_sys" => element.dyn_ref::<HtmlButtonElement>(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jstarry travis-ci complains about unsuported configuration: here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@captain-yossarian you need to make sure your code works for stdweb:

(cd yew-stdweb && cargo check)

@captain-yossarian
Copy link
Contributor Author

@jstarry @teymour-aldridge cargo check does not work in yew\src\virtual_dom>cargo check.
Error: unresolved import web_sys::HtmlButtonElement``. I'm sure 100% HtmlButtonElement exist in web_sys.

@teymour-aldridge
Copy link
Contributor

teymour-aldridge commented May 10, 2020

@captain-yossarian I don't think that's the problem. I think the cfg_match! macro invocation is being used incorrectly (log1, log2). cfg_match source code

@captain-yossarian
Copy link
Contributor Author

captain-yossarian commented May 12, 2020

@captain-yossarian I don't think that's the problem. I think the cfg_match! macro invocation is being used incorrectly (log1, log2). cfg_match source code

@teymour-aldridge Should I have minimum 2 conditions inside cfg_match ? I'm not so experienced rustacean :) to read source code of cdf_match macro

@teymour-aldridge
Copy link
Contributor

I'm not sure. What happens if you just use #[cfg(feature="web_sys")]?

@teymour-aldridge
Copy link
Contributor

teymour-aldridge commented May 23, 2020

@captain-yossarian Have you been able to fix it?

@captain-yossarian
Copy link
Contributor Author

@teymour-aldridge Unfortunately, no

@jstarry jstarry merged commit 4b0d3d2 into yewstack:master May 26, 2020
@jstarry
Copy link
Member

jstarry commented May 26, 2020

Thanks @captain-yossarian! I fixed up the yew-stdweb for ya :)

@captain-yossarian
Copy link
Contributor Author

@jstarry Wow, thanks. I did not know we can apply #[cfg(feature = "web_sys")] to code blocks )

@captain-yossarian captain-yossarian deleted the issue/750 branch May 26, 2020 17:21
@jstarry
Copy link
Member

jstarry commented May 26, 2020

You're welcome! Hope someday we can apply it to if blocks too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

button type attribute is not render
3 participants