Coder Social home page Coder Social logo

Comments (9)

tomhalley avatar tomhalley commented on June 16, 2024

Here is the HTML it renders from chrome devtools:

<div class="row">
  <div class="input-field col s12">
    <select multiple="" name="categories" id="9vT38QXCTtCirrLGr" data-schema-key="categories" class="browser-default">
        <option value="Birds">Birds</option>
        <option value="Mammals">Mammals</option>     
    </select>
    <label for="9vT38QXCTtCirrLGr" class="active">Tags</label>     
  </div>
</div>

from meteor-autoform-materialize.

tomhalley avatar tomhalley commented on June 16, 2024

I figured it out.

Why does this file: meteor-autoform-materialize/inputTypes/select-multiple/select-multiple.js basically make the select-multiple not work with materialize?

from meteor-autoform-materialize.

Chey47 avatar Chey47 commented on June 16, 2024

so what did you do my friend ??? :(

from meteor-autoform-materialize.

tomhalley avatar tomhalley commented on June 16, 2024

Ah sorry, I'll just go back over the code and update here

from meteor-autoform-materialize.

tomhalley avatar tomhalley commented on June 16, 2024

I'll get back with an answer for you tomorrow, don't have access to a working copy ATM. Sorry!

from meteor-autoform-materialize.

Chey47 avatar Chey47 commented on June 16, 2024

take all your time my friend :) thank you in advance

from meteor-autoform-materialize.

tomhalley avatar tomhalley commented on June 16, 2024

In my subscriptions for the category object, I added in some jquery bits to sort the rendering out.

self.subscribe('categories', function() {
    setTimeout(function()` {
        $("select.browser-default").removeClass('browser-default');
        $("select").material_select();
    }, 100);
});

I also took the multiple-select out of the schema, but i don't think it made a lot of difference.

categories: {
    type: [String],
    label: "Tags",
    autoform: {
        options: function() {
            return Categories.find().map(function(a) {
            return {label: a.title, value: a.title}
        })
    }
},

from meteor-autoform-materialize.

Chey47 avatar Chey47 commented on June 16, 2024

thank you for your answer it does work fine, but i kinda found a better solution if it would interest anyone :

categories: {
        type: [String],
        optional: false,
        label: "Categories",
        autoform: {
            type: "select",
                afFieldInput: {
                  multiple: true
              }
        }
    },

from meteor-autoform-materialize.

tomhalley avatar tomhalley commented on June 16, 2024

Just tried your solution, unfortunately, it did nothing except give me a multiple select in the traditional sense, not a dropdown with multiple selector

from meteor-autoform-materialize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.