schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs and SSR.
https://jasprpad.schultek.de
MIT License
1.01k stars 59 forks source link

fix: broken 'new file' functionality in jasprpad and broken samples #159

Closed denniskaselow closed 4 months ago

denniskaselow commented 6 months ago

Description

Some EventCallbacks use e.targetUrl.value but targetValue does not exist on Event.

Steps To Reproduce

  1. Go to https://jasprpad.schultek.de
  2. Click on New File Icon
  3. Enter Filename
  4. Create-Button doesn't become active
  5. Open developer console and see: Uncaught TypeError: e.get$targetUrl is not a function

The same problem exists in the Weather Api (searching for a city results in Error: Parameter q is missing. in addition to the error in the console) and Jaspr Html Samples (selecting a different value in the dropdown). The mbox_hooks experiment should have the same error too. Tested with Chrome and Firefox.

Expected Behavior

No errors

Additional Context

The change from target to targetUrl was introduced a year ago with https://github.com/schultek/jaspr/commit/04cf720a1d885143a8ed97cc4b5f1df157de5740

I'm just starting with Jaspr, so another question (the reason this error is even possible) is why is the event parameter to EventCallback dynamic instead of Event? I'm guessing because of SSR?

schultek commented 6 months ago

Thanks, weird I didn't notice that before.

I'm just starting with Jaspr, so another question (the reason this error is even possible) is why is the event parameter to EventCallback dynamic instead of Event? I'm guessing because of SSR?

Yes, I can't use the Event type on the server since I cant import fromdart:html` there.

denniskaselow commented 4 months ago

It's been fixed for a while now.