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

b-table: redundant padding when !checkable && !paginated #157

Closed
htfy96 opened this issue Jul 5, 2017 · 1 comment
Closed

b-table: redundant padding when !checkable && !paginated #157

htfy96 opened this issue Jul 5, 2017 · 1 comment
Milestone

Comments

@htfy96
Copy link

htfy96 commented Jul 5, 2017

Overview of the problem

Buefy version: 0.4.4
Vuejs version: 2.3.3
OS/Browser: Fx54 on Linux

Description

At the bottom of b-table component, there is a <div class="level"> which the length of checked rows and paginator should be displayed:

<div class="level">
            <div class="level-left">
                <div class="level-item">
                    <p v-if="checkable && this.checkedRows.length > 0">({{ this.checkedRows.length }})</p>
                </div>
            </div>

            <div class="level-right" v-if="paginated">
                <div class="level-item">
                    <b-pagination
                        :total="newData.length"
                        :per-page="perPage"
                        :simple="paginationSimple"
                        :current="currentPage"
                        @change="pageChanged">
                    </b-pagination>
                </div>
            </div>
</div>

However, when checkable and paginated are both false, this snippet would be rendered to:

<div class="level">
  <div class="level-left">
    <div class="level-item">
    </div>
  </div>
</div>

Since there is a rule which adds padding to .table .level, this redundant level component causes unexpected padding at the bottom of <b-table>.

Steps to reproduce

Introduce an arbitrary <b-table> component with checkable == false && paginated && false, observe that there is a redundant <div class="level"> element at the end of .b-class-content.

Expected behavior

.level should not be displayed when !checkable && !paginated

Actual behavior

.level is always displayed.

@rafaberaldo rafaberaldo added this to the v0.4.5 milestone Jul 5, 2017
@akrz
Copy link

akrz commented Aug 1, 2018

An empty div level class will show even if you don't want to display the length of checked rows.

<b-table
    :data="availableCharts"
    :checked-rows.sync="checkedCharts"
    :striped="true"
    :narrowed="false"
    :checkable="true"
    :paginated="false"
    >
    <template slot-scope="props">
        <b-table-column field="description" label="Chart">
            {{ props.row.description }}
        </b-table-column>
        <b-table-column label="Include Summary" width="155" numeric>
            <b-switch size="is-small" v-model="props.row.summary"></b-switch>
        </b-table-column>
    </template>
    <template slot="footer">
        <button class="button field is-danger is-small is-outlined" @click="checkedCharts = []"
            :disabled="!checkedCharts.length">
            <b-icon icon="close"></b-icon>
            <span>Clear</span>
        </button>
    </template>
</b-table>

bug_buefy

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

No branches or pull requests

3 participants