You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug or question
Triggering a click event on a button results in a 'Bunit.ElementNotFoundException' exception. I have a form component with an edit button, after a click on the button it then is removed from the DOM. The form then shows a cancel and submit button. I can see that the click is being handled, so I think it's being referenced after being removed from DOM.
Bunit.ElementNotFoundException
Exception of type 'Bunit.ElementNotFoundException' was thrown.
at Bunit.ElementFactory`1.AngleSharpWrappers.IElementFactory<TElement>.GetElement() in /_/src/bunit.web/Extensions/Internal/ElementFactory.cs:line 30
at AngleSharpWrappers.Wrapper`1.get_WrappedElement()
at AngleSharpWrappers.ElementWrapper.HasAttribute(String name)
at Bunit.GeneralEventDispatchExtensions.TriggerEventAsync(IElement element, String eventName, EventArgs eventArgs) in /_/src/bunit.web/EventDispatchExtensions/GeneralEventDispatchExtensions.cs:line 49
at Bunit.MouseEventDispatchExtensions.ClickAsync(IElement element, MouseEventArgs eventArgs) in /_/src/bunit.web/EventDispatchExtensions/MouseEventDispatchExtensions.cs:line 304
at Bunit.MouseEventDispatchExtensions.Click(IElement element, Int64 detail, Double screenX, Double screenY, Double clientX, Double clientY, Int64 button, Int64 buttons, Boolean ctrlKey, Boolean shiftKey, Boolean altKey, Boolean metaKey, String type) in /_/src/bunit.web/EventDispatchExtensions/MouseEventDispatchExtensions.cs:line 286
at XUnitTestProject1.UnitTest1.Test1
Expected behavior:
Click of the button should work without an error. As a workaround I now use cut.FindAll("button.editbutton")[0].Click();
Version info:
Library version: v1.0.0-beta-11
The text was updated successfully, but these errors were encountered:
I figured out the root cause and there is a fix on the way to the nightly channel now. I really appreciate the effort you put in to creating small repro samples. It makes my bug finding much easier. Thanks again!
Describe the bug or question
Triggering a click event on a button results in a 'Bunit.ElementNotFoundException' exception. I have a form component with an edit button, after a click on the button it then is removed from the DOM. The form then shows a cancel and submit button. I can see that the click is being handled, so I think it's being referenced after being removed from DOM.
I've made a small project to reproduce the exception: XUnitTestProject1.zip
Example:
Testing this component:
With this test:
Results in this output:
Expected behavior:
Click of the button should work without an error. As a workaround I now use
cut.FindAll("button.editbutton")[0].Click();
Version info:
The text was updated successfully, but these errors were encountered: