dobtco / dvl-core

Base styles for the DOBT View Layer.
https://design.dobt.co/
1 stars 1 forks source link

investigate <select> FOUC #296

Open jrubenoff opened 7 years ago

jrubenoff commented 7 years ago

From @ajb on August 5, 2015 15:39

http://take.ms/F5AFT

Copied from original issue: dobtco/dobt#1286

jrubenoff commented 7 years ago

From @ajb on August 12, 2015 14:28

So it's pretty obvious what's happening: the page is loading before .styledSelect() is called, which means that it loads without the <div class='styled_select_wrapper'>. The weirdest part, though, is that I can't get this to happen in development. I've even tried minifying/compiling my assets like they are in production, and it still doesn't occur.

@jrubenoff, do you have any ideas here? My next step was to use the "Timeline" tab in devtools to investigate.

jrubenoff commented 7 years ago

Ideally we would render the markup server-side. Was never quite sure why we're using JS for this.

I understand the switch would take effort, though.

jrubenoff commented 7 years ago

From @ajb on August 12, 2015 18:5

Yeah, I'll consider that as a possible option. The biggest reason is that we don't really control all of the HTML that we render... from stuff like simple_form and other rails helpers, to js like formrenderer.

Maybe the solution is to render the wrapper server-side for some things, and leave it client-side for things like formrenderer, which don't have this FOUC issue.

On Wed, Aug 12, 2015 at 2:03 PM, Josh Rubenoff notifications@github.com wrote:

Ideally we would render the markup server-side. Was never quite sure why we're using JS for this.

I understand the switch would take effort, though.

— Reply to this email directly or view it on GitHub https://github.com/dobtco/dobt/issues/1286#issuecomment-130394401.

Adam Becker (951) 9-BECKER @AdamJacobBecker

jrubenoff commented 7 years ago

From @ajb on October 6, 2015 18:55

Fuck it, putting this on hold.

jrubenoff commented 7 years ago

From @ajb on October 6, 2015 18:55

Wrapping things server-side is really crappy, since we would need to monkey-patch Rails' form helpers.