Honor preventdefault for events so they don't bubble#982
Honor preventdefault for events so they don't bubble#982linkdotnet merged 10 commits intobUnit-dev:mainfrom
Conversation
src/bunit.web/EventDispatchExtensions/TriggerEventDispatchExtensions.cs
Outdated
Show resolved
Hide resolved
|
Ok, I think I finally understood what @linkdotnet was saying, so I moved the behaviour to where the submit is triggered for the buttons. Could you take another look? |
The change itself looks good to me. A few minor things:
|
I don't even know what name would be correct |
|
I did an update, it occurred to me that even with stoppropagation the submit would be done. I finally think this is correctly simulating the browser/blazor behaviour now. |
|
There are some build errors. |
|
The build is fixed, there was one additional ";" |
|
Could you add an entry to the CHANGELOG.md? |
|
Will run the checks and merge it afterward - thanks again @JelleHissink |
|
Any idea when it might be released in a new version? |
We can do a release later this week. |
|
@JelleHissink there is a new release out now. |
* build(deps): Bump SonarAnalyzer.CSharp from 8.51.0.59060 to 8.52.0.60960 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 8.51.0.59060 to 8.52.0.60960. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](SonarSource/sonar-dotnet@8.51.0.59060...8.52.0.60960) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build: set AccelerateBuildsInVisualStudio to true * chore: upgrade anglesharp.diffing to 0.17.1 * docs: update changelog * Revert AngleSharp from 1.0.1 to 0.17.1 This reverts commit 8ac537a. # Conflicts: # src/AngleSharpWrappers/AngleSharpWrappers.csproj # src/bunit.web/bunit.web.csproj * Set version to '1.15' * Set version to '1.16-preview' * Updated CHANGELOG.md for 1.15.5 release * fix: allow semantic comparer to compare IHtmlUnknownElement types * Set version to '1.16' * Set version to '1.17-preview' * Updated CHANGELOG.md for 1.16.2 release * fix: wrong type assignment in doc (#975) * refactor: Use PackageOutputPath instead of -o * build(deps): Bump System.Text.Json from 7.0.1 to 7.0.2 Bumps [System.Text.Json](https://github.com/dotnet/runtime) from 7.0.1 to 7.0.2. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](dotnet/runtime@v7.0.1...v7.0.2) --- updated-dependencies: - dependency-name: System.Text.Json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Honor preventdefault for events so they don't bubble (#982) * Honor preventdefault for events so they don't bubble * Small change to fix the normal bubbling events * Small rename of a private method to better indicate its intention * Improvement and simplification * Build fix by removing an empty statement * Changelog * formatting of the changelog * Updated changelog --------- Co-authored-by: Steven Giesel <stgiesel35@gmail.com> * build(deps): Bump BenchmarkDotNet from 0.13.4 to 0.13.5 Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) from 0.13.4 to 0.13.5. - [Release notes](https://github.com/dotnet/BenchmarkDotNet/releases) - [Commits](dotnet/BenchmarkDotNet@v0.13.4...v0.13.5) --- updated-dependencies: - dependency-name: BenchmarkDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Set version to '1.17' * Set version to '1.18-preview' * Updated CHANGELOG.md for 1.17.2 release * build(deps): Bump AutoFixture from 4.17.0 to 4.18.0 Bumps [AutoFixture](https://github.com/AutoFixture/AutoFixture) from 4.17.0 to 4.18.0. - [Release notes](https://github.com/AutoFixture/AutoFixture/releases) - [Commits](AutoFixture/AutoFixture@v4.17.0...v4.18.0) --- updated-dependencies: - dependency-name: AutoFixture dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): Bump AutoFixture.Xunit2 from 4.17.0 to 4.18.0 Bumps [AutoFixture.Xunit2](https://github.com/AutoFixture/AutoFixture) from 4.17.0 to 4.18.0. - [Release notes](https://github.com/AutoFixture/AutoFixture/releases) - [Commits](AutoFixture/AutoFixture@v4.17.0...v4.18.0) --- updated-dependencies: - dependency-name: AutoFixture.Xunit2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): Bump Microsoft.NET.Test.Sdk from 17.4.1 to 17.5.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.4.1 to 17.5.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](microsoft/vstest@v17.4.1...v17.5.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Escape text inside html tag and attributes * fix: Added tests for escpable characters * fix: Escape text inside html tag * Added changelog entry * chore: code cleanup * fix: optimize char replacement --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * build(deps): Bump SonarAnalyzer.CSharp from 8.52.0.60960 to 8.53.0.62665 (#988) * build(deps): Bump SonarAnalyzer.CSharp from 8.52.0.60960 to 8.53.0.62665 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 8.52.0.60960 to 8.53.0.62665. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](SonarSource/sonar-dotnet@8.52.0.60960...8.53.0.62665) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: code analyzer rules code updates --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Egil Hansen <egil@assimilated.dk> * fix: submit button/input element submits form (#1000) * fix: submit button/input element submits form * handle other edge cases * code clean up * simplify conditionals * Set version to '1.18' * Set version to '1.19-preview' * Updated CHANGELOG.md for 1.18.4 release * chore: use file scoped namespaces * Simplify null coalescing * refactor: use early return and simplify call * fix(nullable): forward nullability correctly (#1013) * fix(nullable): forward nullability correctly * Update src/bunit.web/TestContext.cs Co-authored-by: Egil Hansen <egil@assimilated.dk> --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: improve examples of semantic comparison modifiers * build(deps): Bump AngleSharp.Diffing from 0.17.1 to 0.18.1 Bumps [AngleSharp.Diffing](https://github.com/AngleSharp/AngleSharp.Diffing) from 0.17.1 to 0.18.1. - [Release notes](https://github.com/AngleSharp/AngleSharp.Diffing/releases) - [Changelog](https://github.com/AngleSharp/AngleSharp.Diffing/blob/devel/CHANGELOG.md) - [Commits](AngleSharp/AngleSharp.Diffing@v0.17.1...v0.18.1) --- updated-dependencies: - dependency-name: AngleSharp.Diffing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * docs: Use TestContext as base class for Passing parameters to components (#1034) * refactor: Use TestContext as base class * fixes to docs * Indent size 2 * fix getting started and index --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: broken sample code * doc: fixes to sample code to make it compile * docs: added CounterTest.razor * docs: fix code references, added missing samples * docs: Use TestContext as base class for Passing parameters to components (#1034) * refactor: Use TestContext as base class * fixes to docs * Indent size 2 * fix getting started and index --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: broken sample code * doc: fixes to sample code to make it compile * docs: added CounterTest.razor * docs: fix code references, added missing samples * docs: change code ref to correct type * chore: code clean up * fix: clean up tests * fix: run markup updates in users sync context * fix: synchronize code that reads/writes to the internal render tree in TestRenderer/Renderer * build(deps): Bump SonarAnalyzer.CSharp from 8.54.0.63966 to 8.56.0.67649 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 8.54.0.63966 to 8.56.0.67649. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](https://github.com/SonarSource/sonar-dotnet/commits/8.56.0.67649) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): Bump dotnet-serve from 1.7.125 to 1.10.155 Bumps [dotnet-serve](https://github.com/natemcmaster/dotnet-serve) from 1.7.125 to 1.10.155. - [Release notes](https://github.com/natemcmaster/dotnet-serve/releases) - [Commits](https://github.com/natemcmaster/dotnet-serve/commits/v1.10.155) --- updated-dependencies: - dependency-name: dotnet-serve dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Custom elements with attributes throw exception * fix: Better naming for test method (#1048) * fix: Better naming for test method * fix: Don't use unknown matcher first * fix: Don't use unknown matcher first * Add attribute * Merge stable into main (#1050) * docs: Use TestContext as base class for Passing parameters to components (#1034) * refactor: Use TestContext as base class * fixes to docs * Indent size 2 * fix getting started and index --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: broken sample code * doc: fixes to sample code to make it compile * docs: added CounterTest.razor * docs: fix code references, added missing samples * docs: change code ref to correct type --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * Set version to '1.19' * Set version to '1.20-preview' * Updated CHANGELOG.md for 1.19.14 release * Update to net8.0 * Remove preprocessor directives * Wave 2 * Remove net60 dep in test * More changes * Bump actions --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Egil Hansen <egil@assimilated.dk> Co-authored-by: bUnit bot <bot@bunit.dev> Co-authored-by: JelleHissink <Jelle@CodeWise.nl> Co-authored-by: Florian Dohrendorf <LunicLynx@users.noreply.github.com>
* build(deps): Bump SonarAnalyzer.CSharp from 8.51.0.59060 to 8.52.0.60960 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 8.51.0.59060 to 8.52.0.60960. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](SonarSource/sonar-dotnet@8.51.0.59060...8.52.0.60960) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build: set AccelerateBuildsInVisualStudio to true * chore: upgrade anglesharp.diffing to 0.17.1 * docs: update changelog * Revert AngleSharp from 1.0.1 to 0.17.1 This reverts commit 8ac537a. # Conflicts: # src/AngleSharpWrappers/AngleSharpWrappers.csproj # src/bunit.web/bunit.web.csproj * Set version to '1.15' * Set version to '1.16-preview' * Updated CHANGELOG.md for 1.15.5 release * fix: allow semantic comparer to compare IHtmlUnknownElement types * Set version to '1.16' * Set version to '1.17-preview' * Updated CHANGELOG.md for 1.16.2 release * fix: wrong type assignment in doc (#975) * refactor: Use PackageOutputPath instead of -o * build(deps): Bump System.Text.Json from 7.0.1 to 7.0.2 Bumps [System.Text.Json](https://github.com/dotnet/runtime) from 7.0.1 to 7.0.2. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](dotnet/runtime@v7.0.1...v7.0.2) --- updated-dependencies: - dependency-name: System.Text.Json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Honor preventdefault for events so they don't bubble (#982) * Honor preventdefault for events so they don't bubble * Small change to fix the normal bubbling events * Small rename of a private method to better indicate its intention * Improvement and simplification * Build fix by removing an empty statement * Changelog * formatting of the changelog * Updated changelog --------- Co-authored-by: Steven Giesel <stgiesel35@gmail.com> * build(deps): Bump BenchmarkDotNet from 0.13.4 to 0.13.5 Bumps [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) from 0.13.4 to 0.13.5. - [Release notes](https://github.com/dotnet/BenchmarkDotNet/releases) - [Commits](dotnet/BenchmarkDotNet@v0.13.4...v0.13.5) --- updated-dependencies: - dependency-name: BenchmarkDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Set version to '1.17' * Set version to '1.18-preview' * Updated CHANGELOG.md for 1.17.2 release * build(deps): Bump AutoFixture from 4.17.0 to 4.18.0 Bumps [AutoFixture](https://github.com/AutoFixture/AutoFixture) from 4.17.0 to 4.18.0. - [Release notes](https://github.com/AutoFixture/AutoFixture/releases) - [Commits](AutoFixture/AutoFixture@v4.17.0...v4.18.0) --- updated-dependencies: - dependency-name: AutoFixture dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): Bump AutoFixture.Xunit2 from 4.17.0 to 4.18.0 Bumps [AutoFixture.Xunit2](https://github.com/AutoFixture/AutoFixture) from 4.17.0 to 4.18.0. - [Release notes](https://github.com/AutoFixture/AutoFixture/releases) - [Commits](AutoFixture/AutoFixture@v4.17.0...v4.18.0) --- updated-dependencies: - dependency-name: AutoFixture.Xunit2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): Bump Microsoft.NET.Test.Sdk from 17.4.1 to 17.5.0 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.4.1 to 17.5.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](microsoft/vstest@v17.4.1...v17.5.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Escape text inside html tag and attributes * fix: Added tests for escpable characters * fix: Escape text inside html tag * Added changelog entry * chore: code cleanup * fix: optimize char replacement --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * build(deps): Bump SonarAnalyzer.CSharp from 8.52.0.60960 to 8.53.0.62665 (#988) * build(deps): Bump SonarAnalyzer.CSharp from 8.52.0.60960 to 8.53.0.62665 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 8.52.0.60960 to 8.53.0.62665. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](SonarSource/sonar-dotnet@8.52.0.60960...8.53.0.62665) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: code analyzer rules code updates --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Egil Hansen <egil@assimilated.dk> * fix: submit button/input element submits form (#1000) * fix: submit button/input element submits form * handle other edge cases * code clean up * simplify conditionals * Set version to '1.18' * Set version to '1.19-preview' * Updated CHANGELOG.md for 1.18.4 release * chore: use file scoped namespaces * Simplify null coalescing * refactor: use early return and simplify call * fix(nullable): forward nullability correctly (#1013) * fix(nullable): forward nullability correctly * Update src/bunit.web/TestContext.cs Co-authored-by: Egil Hansen <egil@assimilated.dk> --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: improve examples of semantic comparison modifiers * build(deps): Bump AngleSharp.Diffing from 0.17.1 to 0.18.1 Bumps [AngleSharp.Diffing](https://github.com/AngleSharp/AngleSharp.Diffing) from 0.17.1 to 0.18.1. - [Release notes](https://github.com/AngleSharp/AngleSharp.Diffing/releases) - [Changelog](https://github.com/AngleSharp/AngleSharp.Diffing/blob/devel/CHANGELOG.md) - [Commits](AngleSharp/AngleSharp.Diffing@v0.17.1...v0.18.1) --- updated-dependencies: - dependency-name: AngleSharp.Diffing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * docs: Use TestContext as base class for Passing parameters to components (#1034) * refactor: Use TestContext as base class * fixes to docs * Indent size 2 * fix getting started and index --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: broken sample code * doc: fixes to sample code to make it compile * docs: added CounterTest.razor * docs: fix code references, added missing samples * docs: Use TestContext as base class for Passing parameters to components (#1034) * refactor: Use TestContext as base class * fixes to docs * Indent size 2 * fix getting started and index --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: broken sample code * doc: fixes to sample code to make it compile * docs: added CounterTest.razor * docs: fix code references, added missing samples * docs: change code ref to correct type * chore: code clean up * fix: clean up tests * fix: run markup updates in users sync context * fix: synchronize code that reads/writes to the internal render tree in TestRenderer/Renderer * build(deps): Bump SonarAnalyzer.CSharp from 8.54.0.63966 to 8.56.0.67649 Bumps [SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from 8.54.0.63966 to 8.56.0.67649. - [Release notes](https://github.com/SonarSource/sonar-dotnet/releases) - [Commits](https://github.com/SonarSource/sonar-dotnet/commits/8.56.0.67649) --- updated-dependencies: - dependency-name: SonarAnalyzer.CSharp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): Bump dotnet-serve from 1.7.125 to 1.10.155 Bumps [dotnet-serve](https://github.com/natemcmaster/dotnet-serve) from 1.7.125 to 1.10.155. - [Release notes](https://github.com/natemcmaster/dotnet-serve/releases) - [Commits](https://github.com/natemcmaster/dotnet-serve/commits/v1.10.155) --- updated-dependencies: - dependency-name: dotnet-serve dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Custom elements with attributes throw exception * fix: Better naming for test method (#1048) * fix: Better naming for test method * fix: Don't use unknown matcher first * fix: Don't use unknown matcher first * Add attribute * Merge stable into main (#1050) * docs: Use TestContext as base class for Passing parameters to components (#1034) * refactor: Use TestContext as base class * fixes to docs * Indent size 2 * fix getting started and index --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * docs: broken sample code * doc: fixes to sample code to make it compile * docs: added CounterTest.razor * docs: fix code references, added missing samples * docs: change code ref to correct type --------- Co-authored-by: Egil Hansen <egil@assimilated.dk> * Set version to '1.19' * Set version to '1.20-preview' * Updated CHANGELOG.md for 1.19.14 release * Update to net8.0 * Remove preprocessor directives * Wave 2 * Remove net60 dep in test * More changes * Bump actions --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Egil Hansen <egil@assimilated.dk> Co-authored-by: bUnit bot <bot@bunit.dev> Co-authored-by: JelleHissink <Jelle@CodeWise.nl> Co-authored-by: Florian Dohrendorf <LunicLynx@users.noreply.github.com>
This solves issue #981