angular icon indicating copy to clipboard operation
angular copied to clipboard

Date/Time Component Rendering Issue In Prod Build

Open cfsilence opened this issue 8 years ago • 10 comments

I'm seeing issues with the Data Grid component in a prod build (ng build --prod) on 1.8.0.

The component renders properly in dev mode (npm start) locally, but on the server the fields are all being displayed as read only and it looks like the 'flatpickr' CSS isn't being included in the build because a gigantic arrow icon with the classes flatpickr-calendar hasTime animate is shown at the bottom of the page and there aren't any flatpickr related styles applied to it.

Let me know if you need any more info on this issue, thanks!

cfsilence avatar Jan 19 '18 18:01 cfsilence

Dev version:

image

Prod version:

image

Gigantic SVG arrow at bottom of page:

image

cfsilence avatar Jan 19 '18 18:01 cfsilence

In looking at it, only the date pickers are readonly I guess.

cfsilence avatar Jan 19 '18 18:01 cfsilence

Updated the title, the issue is related to the date/time component, not the data grid.

cfsilence avatar Jan 19 '18 18:01 cfsilence

I believe the issue is here:

https://github.com/formio/angular-formio/blob/master/src/formio.component.ts#L39

As explained here:

https://github.com/angular/angular-cli/issues/6422

Can you switch to using:

styleUrls: ['formio.component.scss']

instead of inlining the styles?

cfsilence avatar Jan 19 '18 19:01 cfsilence

I looked into doing this, but it didn't seem to work with a package build. I may experiment with some more things but will try to get this resolved ASAP.

travist avatar Jan 19 '18 22:01 travist

I'm trying to include that css directly into my build to bypass the error, but our Jenkins server is having issues at the moment so I can't confirm that it works just yet. I'll let you know if it does.

cfsilence avatar Jan 19 '18 23:01 cfsilence

What I may have to do is resolve this on the renderer side @ https://github.com/formio/formio.js where it just includes the css directly into the DOM. Let me know if you have any luck on your end and I may go that route.

travist avatar Jan 20 '18 04:01 travist

OK, got my build deployed and confirmed that including the CSS directly into my stylesheet via:

@import '../node_modules/angular-formio/formio.component';

Resolved this issue for me. It's not the most elegant solution, but it works so I'm happy.

cfsilence avatar Jan 21 '18 05:01 cfsilence

I am also having the same issue but adding the @import directly to my CSS didn't resolve the issue. Currently using version 1.17.0.

Thanks.

astacy2 avatar Feb 23 '18 15:02 astacy2

This should be fixed in latest version. Please verify if it is not.

travist avatar Jul 23 '18 15:07 travist