Open silviokennecke opened 6 years ago
Any chance this is going to be merged? There is a bug in the current version of materialize-css v0.100.X that makes selects (and apparently datepickers) not work. That was fixed in v1.0.0.
having that same problem over here, looks like this repo is abandoned, any other solutions for this?
@jelkinsiv @alex-bluetrain I found a work around for the issue you're having cause I had it too.
Here is my custom fix. This downloads a version of Materialize that isn't on NPM yet, and moves it to the node_packages folder. It won't work for you out of the box, but you should be able to read the code and understand what is happening. Then modify it or run it manually to fix the issue.
`/**
the newest version of materialize-css. This function fixes the dependency with the chrome-73 bug */ (function () { 'use strict';
const gulpfile = require('../../server-src/node_modules/gulp'); const clean = require('../../server-src/node_modules/gulp-clean'); const execSync = require('child_process').execSync;
let silent = false; for (let j = 0; j < process.argv.length; j++) { if(process.argv[j] === '--silent') silent = true; }
if(!silent) console.log('Starting task [Fix Dependencies - Materialize]');
execSync( 'git clone --quiet https://github.com/Dogfalo/materialize.git' + // clone the repo ' && ' + 'cd materialize' + // move into repo // ' && ' + // 'git checkout master' + // could checkout master, but no guarantee the source will work ' && ' + 'git checkout --quiet e3eb698a07fec1d3111c1786bf502f0225bdfbda' + // checkout latest working build for us ' && ' + 'npm install --silent -g grunt-cli' + // ensure grunt-cli is installed ' && ' + 'npm install --silent' + // install local packages ' && ' + 'grunt release' + // build materialize files ' && ' + 'cd ..' // move out of repo );
// move css files gulpfile .src('./materialize/dist/css/**') .pipe(gulpfile.dest('../../angular-src/node_modules/materialize-css/dist/css/'));
// move javascript files gulpfile .src('./materialize/dist/js/**') .pipe(gulpfile.dest('../../angular-src/node_modules/materialize-css/dist/js/'));
// delete source gulpfile .src('./materialize', { read: false, allowEmpty: true }) .pipe(clean({ force: true }));
if(!silent) console.log('Finished task [Fix Dependencies - Materialize]'); })();`
How it works:
git clone --quiet https://github.com/Dogfalo/materialize.git
Clones the materialize git
git checkout --quiet e3eb698a07fec1d3111c1786bf502f0225bdfbda
Checks out the commit that fixes the chrome bug
npm install --silent -g grunt-cli
Downloads the build process that builds materialize
npm install --silent
Installs the necessary packages to build
grunt release
Builds the materialize packages.
Then the gulp functions move the built code to the node_modules.
*** NOTE: This node application only works with Node version 8. It does not work with any Node version greater than 8. For some reason, doing a git clone using execSync in Node v10 and greater, causes an exception to be thrown.
Any chance this is going to be merged? There is a bug in the current version of materialize-css v0.100.X that makes selects (and apparently datepickers) not work. That was fixed in v1.0.0.