Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.29k stars 532 forks source link

Table component throwing JS error #164

Closed djlaney3 closed 5 years ago

djlaney3 commented 5 years ago

When I use the tablecomponent and click anywhere on the rendered html, I get the following javascript error: system.MissingMethodException: Method not found: 'Int64 Microsoft.AspNetCore.Components.UIMouseEventArgs.get_ScreenX()'. at Blazorise.Utils.EventArgsMapper.ToMouseEventArgs(UIMouseEventArgs e) at Blazorise.Base.BaseTableRowCell.HandleClick(UIMouseEventArgs e) --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.Rendering.Renderer.GetErrorHandledTask(Task taskToHandle)

stsrki commented 5 years ago

Can you show me example of your code where you use Table component? Also what version of Blazor you're using? It should work because I use that event in the new DataGrid component.

djlaney3 commented 5 years ago

Version: 0.7.8 `

Source Name Received Entry Date Entry @foreach (var logEntry in logEntries) { @logEntry.LogSource.SourceName @logEntry.Received.ToString() @logEntry.LogEntryDate.ToString() @logEntry.LogEntry } ` I looked at the source code and found a potential issue: ` public static MouseEventArgs ToMouseEventArgs( UIMouseEventArgs e ) { if ( e == null ) return null; return new MouseEventArgs( ToMouseButton( e.Button ), (int)e.Detail, new Point( (int)e.ScreenX, (int)e.ScreenY ), new Point( (int)e.ClientX, (int)e.ClientY ), e.CtrlKey, e.ShiftKey, e.AltKey ); }` e.Detail returns a long, but you are converting to an int. Not sure if that is a true issue.
stsrki commented 5 years ago

Hi, sorry for the late reply. I was busy publishing new version of Blazorise.

Anyways, I don't see that you're using Clicked event in your example. I could try and convert int fields to long type, but since I cannot test why it's failing it's just a blind guess.

Please try the latest version and if bug is still present I will see what I can do.

djlaney3 commented 5 years ago

The update fixed it. Thanks!