creativetimofficial / ct-material-dashboard-pro

Material Dashboard Pro - Premium Bootstrap 5 Admin
https://demos.creative-tim.com/material-dashboard-pro/pages/dashboards/analytics
116 stars 28 forks source link

SCSS does not match CSS File for file input (z-index) #275

Open AndyWorral opened 4 years ago

AndyWorral commented 4 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expected Behavior

The demo here https://demos.creative-tim.com/material-dashboard-pro/docs/2.1/plugins/fileupload-jasny.html allow you to click anywhere on the file selection button

Current Behavior

The text span is not clickable in the span and cursor changes on hover of it. To reproduce just edit the file input to have a -1 z-index

element.style {
    z-index: -1;
}

Issue Found

If you view the computed css for the file input inside the span it has no z-index. However the scss file generates a css file that does and has a value of -1. This causes a different behavior then the demo and also leads me to believe the demo css is not generated from the scss files or I'm generating it differently?

material-dashboard-pro-html-v2.1.2\material-dashboard-pro-html-v2.1.2\assets\scss\material-dashboard_forms.scss

.form-group input[type=file] {
  opacity: 0;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
groovemen commented 4 years ago

Hello @AndyWorral,

Thank you for using our products and for your constructive feedback! We will solve this issue in the next update of the product. Also, related to the demo version and the downloadable one, they are just the same. If you will check the minified CSS (because we are using the minified version for demo) from your project and search after input[type=file] in it, you will notice that the negative z-index is also found in the CSS. Even if you set a bigger z -index in material-dashboard-pro-html-v2.1.2\material-dashboard-pro-html-v2.1.2\assets\scss\material-dashboard_forms.scss, the text span from button will have the same behaviour. Hope this information helps you. Please let us know if we can help you with anything else.

All the best, Stefan