Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for materialize-css ^1.0.0 #441

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Updated for materialize-css ^1.0.0 #441

wants to merge 4 commits into from

Conversation

silviokennecke
Copy link

No description provided.

Copy link
Contributor

@pawelhertman pawelhertman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample project's code still require few modifications

@jelkinsiv
Copy link

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.

@alex-bluetrain
Copy link

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?

@tuffant21
Copy link

tuffant21 commented Jun 18, 2019

@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.

`/**

  • So Chrome-73 introduced a bug with materialize-css. It introduced a race-condition in which the date-picker would

  • open and immediately close - repeatedly with no way to fix it. The developers of materialize published a fix on

  • github, but have not published the fix to node package manager (npm). I find it unlikey they will do so since

  • v. 0.100.2 is soon to be deprecated. We are forced to stick with this version until angular2-materialize supports

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants