[X] Are you running the latest version of AngleSharp? Using AngleSharp 0.15, AngleSharp.Js 0.14
[X] Did you check the FAQs to see if that helps you?
[X] Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)
[X] Did you perform a search in the issues?
For more information, see the CONTRIBUTING guide.
Description
A JavaScript function that changes two dataset properties on an element node is successfully called from C# but somehow the dataset property changes are not reflected in the AngleSharp DOM.
Steps to Reproduce
[First Step]
Run code
using System;
using System.Threading.Tasks;
using AngleSharp;
using AngleSharp.Html.Dom;
using AngleSharp.Scripting;
namespace DatasetMWE
{
class Program
{
static async Task Main(string[] args)
{
var html = @"<!DOCTYPE html>
Test
Test
Section test
";
var jsService = new JsScriptingService();
var config = Configuration.Default.With(jsService);
var context = BrowsingContext.New(config);
var document = await context.OpenAsync(req => req.Content(html));
var testFunction = jsService.GetOrCreateJint(document).GetValue("test");
var result = testFunction.Invoke();
Console.WriteLine(document.DocumentElement.OuterHtml);
var sectionEl = document.QuerySelector("section") as IHtmlElement;
Console.WriteLine(sectionEl.Dataset["level"]);
Console.WriteLine(result);
}
}
}
```
**Expected behavior:** The dataset changes the JavaScript function performs should be reflected in the AngleSharp DOM so both the OuterHtml as well as the result output should show the changes, i.e. the output should be
```
Test
Test
Section test
2
test executed
```
**Actual behavior:** I get the output
```
Test
Test
Section test
1
test executed
```
**Environment details:** [OS, .NET Runtime, ...] Windows 10 20H2, .NET 5 (Core) Visual Studio 2019 console project
## Possible Solution
Bug Report
Prerequisites
AngleSharp.Css
for CSS support)For more information, see the
CONTRIBUTING
guide.Description
A JavaScript function that changes two dataset properties on an element node is successfully called from C# but somehow the dataset property changes are not reflected in the AngleSharp DOM.
Steps to Reproduce
namespace DatasetMWE { class Program { static async Task Main(string[] args) { var html = @"<!DOCTYPE html>
Test
Section test
Test
Section test
Test
Section test