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

Fix CssStyleDeclaration.GetPropertyValueAsync<T> return type #9

Closed
sn0wcr4sh opened this issue Oct 28, 2022 · 0 comments
Closed

Fix CssStyleDeclaration.GetPropertyValueAsync<T> return type #9

sn0wcr4sh opened this issue Oct 28, 2022 · 0 comments

Comments

@sn0wcr4sh
Copy link

Description

Generic method GetPropertyValueAsync<T> returns type string, even though int was specified

Example reproducing the issue

// Arrange
await using var devtoolsContext = await coreWebView2.CreateDevToolsContextAsync();
var div = await devToolsContext.QuerySelectorAsync<HtmlDivElement>("#myDiv");  
var style = await div.GetStyleAsync();  

// Act
var zIndex = await style.GetPropertyValueAsync<int>("z-index");

// Assert
Assert.Equal(typeof(int), zIndex.GetType());

Expected behavior:

Get value of type int

Actual behavior:

Correct value is returned, but of type string

Versions

  • WebView2.DevTools.Dom 3.0.0
  • .NET Framework 4.8
@amaitland amaitland changed the title GetPropertyValueAsync<T> return type Fix CssStyleDeclaration.GetPropertyValueAsync<T> return type Oct 28, 2022
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

No branches or pull requests

1 participant