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

Incompatibility issue with Bulma 0.4.0 #32

Open
MBach opened this issue Mar 21, 2017 · 3 comments
Open

Incompatibility issue with Bulma 0.4.0 #32

MBach opened this issue Mar 21, 2017 · 3 comments

Comments

@MBach
Copy link

MBach commented Mar 21, 2017

Hi,
With latest release of Bulma (0.4.0), writing forms must be enclosed by DIV with class field, like this:

<div class="field">
  <label class="label" for="country">Country</label>
  <p class="control is-expanded">
    <span class="select is-fullwidth">
      <select class="is-fullwidth" name="country" v-model="selected_country" @input="updateUser">
        <option v-for="c in countries" v-bind:value="c.id">
          {{ c.country_fr }}
        </option>
      </select>
    </span>
  </p>
</div>

which produces:
image

If I do the same thing with datepicker and "has-addons" on the enclosing DIV, here's what I have:

<label class="label">Start date</label>
<div class="field has-addons">
  <datepicker name="dateForm" v-model="dateForm" :config="{ dateFormat: 'd/m/Y', wrap: true, locale: fr }">
    <a class="button" data-toggle><i class="fa fa-calendar"></i></a>
    <a class="button" data-clear><i class="fa fa-close"></i></a>
  </datepicker>
</div>

image

Note that LABEL needs to be outside when using "has-addons". I think this is another issue from Bulma itself.

@JTallis
Copy link

JTallis commented Apr 4, 2017

Yeah as a result of this I had to copy the files and edit them to my taste. I'm not git savvy myself but here was my solution:

WrapperInput.vue

<template>
    <div class="field has-addons">
        <p class="control is-expanded flatpickr" data-wrap="true" data-clickOpens="false" :class="{ [`has-addons-${alignment}`]: alignment }">
            <input class="input" :class="inputClass" type="text" :placeholder="placeholder" :readonly="readonly" v-model="date" data-input />
        </p>
        <slot></slot>
    </div>
</template>

Form.vue (or whatever you call it)

<div class="field">
    <div class="control has-icon">
        <datepicker placeholder="Date of Birth" :config="{ dateFormat: 'Y-m-d', wrap: true, maxDate: 'today' }">
            <p class="control">
                <a class="button" data-toggle>
                    <i class="fa fa-calendar"></i>
                </a>
            </p>
            <p class="control">
                <a class="button" data-clear>
                    <i class="fa fa-close"></i>
                </a>
            </p>
        </datepicker>
        <span class="icon is-small">
            <i class="fa fa-birthday-cake"></i>
        </span>
    </div>
</div>

I added an icon myself as I'm using it as a date of birth field but of course that is easily omitted.

image

@uptownhr
Copy link

uptownhr commented May 5, 2017

any update here?

@luventa
Copy link
Member

luventa commented Jun 1, 2017

Sorry for replying so late.
I'm going to upgrade version of Bulma for vue-admin and fix this issue these days.

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

No branches or pull requests

4 participants