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

[BUG] ModuleMessage Throws Exception in Static Render Mode For Static Components #4246

Closed
sbwalker opened this issue May 9, 2024 · 0 comments

Comments

@sbwalker
Copy link
Member

sbwalker commented May 9, 2024

Oqtane Info

Version - 5.1.1
Render Mode - Static
Interactivity - Server
Database - SQL Server

Describe the bug

When a module component is using Static render mode, the AddModuleMessage() can be used to display a message to a user. However when a user clicks the X icon to close the message, an error will be produced in the browser similar to the following:

Cannot submit the form 'ModuleMessageForm33' because no form on the page currently has that name.

If you look at the HTML markup of the page prior to clicking the X icon, it appears that the form does exist:

image

Expected Behavior

The message should be closed and no error should occur.

Steps To Reproduce

Anything else?

I believe Blazor may be removing the form element from the DOM before the onsubmit event is fired? Or perhaps the elementreferences in the ModuleMessage component are causing issues.

A secondary issue is that the RenderModeBoundary is creating 2 ModuleMessage components regardless of whether a message needs to be displayed or not. This adds a lot of extra components to a page which is contrary to the performance goals of Oqtane. It would be preferable if ModuleMessage components are only added when a message needs to be displayed.

sbwalker added a commit that referenced this issue May 17, 2024
fix #4246 - module message form exception when clicking close button
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