Fork me on GitHub
#om
<
2017-08-04
>
Garrett Hopper14:08:24

@levitanong I hadn't thought of situations without javascript. I suppose SSR only should be supported, so hrefs make sense.

Garrett Hopper14:08:55

Though I guess my forms should be setup for situations without javascript too. 😕

danielstockton14:08:58

Fwiw, i use hrefs and pushy.

Garrett Hopper14:08:14

That's what I've got now as well.

Garrett Hopper14:08:38

And bidi routes. Though every once in a while I'll throw in an incorrect href and it'll actually try to go to that page, which is a pain.

Garrett Hopper14:08:46

I don't have SSR yet.

levitanong14:08:50

@ghopper and @danielstockton i used to use pushy, but it did some weird things when dealing with xlink:hrefs. This is when you’re trying to use SVG symbols.

danielstockton14:08:46

@levitanong you can fix that with a bit of css pointer-events: none

danielstockton14:08:11

I use a lot of SVG icons for links and had the same issue.

danielstockton14:08:07

You just have to make sure the css is targeted, so you don't mess with events for charts etc... that may also use svg.

levitanong14:08:30

@danielstockton oh I didn’t know that! Thanks for the tip.

Garrett Hopper14:08:01

So if I have a :onSubmit #(.preventDefault %) on a form, then when javascript is disabled, it'll actually post?

danielstockton14:08:57

:onSubmit is a React event-handler and relies on js too

Garrett Hopper14:08:33

So when javascript isn't around it won't prevent it, right?

levitanong14:08:37

@ghopper afaik you would need to fill out the action attribute if you wanted it to work without javascript.

levitanong14:08:50

also, the method

Garrett Hopper14:08:15

Oh yeah, sorry, I was saying if the form was formatted as a valid post form.

Garrett Hopper14:08:52

So I could make all forms be valid forms, but then stop them from actually posting and do om stuff instead.

levitanong14:08:17

I believe so! that’s exactly what pushy does under the hood.

Garrett Hopper14:08:31

Yeah, then combining that with pushy and hrefs and SSR, I should have my app act as either a SPA or multiple pages.

danielstockton14:08:33

You've got your work cut out.