-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
allow collapse on complete card header #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I don't think this should be a card
component feature.
I know it's useful for YOU, for ME, and maybe for others, but Tabler.io doesn't have it.
So we're adding something that Tabler doesn't have or doesn't want.
I've implemented this in all my projects because it's a must IMO.
Instead of using a card, I used an accordion with a single element.
By using the accordion, we have a full button to click (which is the title) and a visual information to tell the user the current state: bold + dynamic arrow up or down.
A parent .card
is there to have the background and a border.
You can even put a .card-footer
inside an accordion element, it works like a charm.
I can give you the code if you want.
Okay, let me try the accordion. Do you use extra code, that is not part of the bundle? If so: yes please share ;) |
It used the new version of the accordion, I've made a PR for it.
Yes we do, but sadly our repo is on a private server..
YOU should maybe replace the How to use{% embed '@AllsoftwareSymfony/_partials/embeds/card_filter.html.twig'%}
{% block filter_body %}
{% include 'tiers/_partials/_filter.html.twig' %}
{% endblock %}
{% endembed %}
|
Raw HTML: (don't mind stimulus elements) <div class="card border-0 mb-3" data-controller="card-filter" data-card-filter-auto-search-value="true">
<form name="tiers_filter" method="post">
<div class="card-body p-0 ">
<div id="accordion_647709f1e0b45" class="accordion ">
<div class="accordion-item ">
<div class="accordion-header " id="accordion_647709f1e0b45-heading-1">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#accordion_647709f1e0b45_collapse_1" aria-expanded="true">
<i class="fas fa-search me-1"></i>Filtres
</button>
</div>
<div id="accordion_647709f1e0b45_collapse_1" data-bs-parent="#accordion_647709f1e0b45" class="accordion-collapse border-top collapse show" style="">
<div class="accordion-body ">
<div class="row">
<div class="col-3">
<div class="mb-3">
<label class="form-label" for="tiers_filter_types-ts-control" id="tiers_filter_types-ts-label">Type</label>
<select id="tiers_filter_types" name="tiers_filter[types][]" class="tom-select form-select tomselected ts-hidden-accessible" data-tom-remove-button="data-tom-remove-button" data-tom-dropdown-input="data-tom-dropdown-input" data-tom-clear-button="data-tom-clear-button" data-tom-query-length="0" data-tom-placeholder="" placeholder="Sélectionner" multiple="multiple" tabindex="-1">
<option value="MOA">MOA</option>
<option value="AMO">AMO</option>
<option value="bureau_etude">Bureau d'étude</option>
<option value="architecte">Architect</option>
<option value="concessionnaire">Concessionnaire</option>
<option value="entreprise">Entreprise</option>
<option value="autre">Autre</option>
</select>
<div class="ts-wrapper tom-select form-select multi plugin-dropdown_input plugin-remove_button plugin-clear_button">
<div class="ts-control" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-controls="tiers_filter_types-ts-dropdown" id="tiers_filter_types-ts-control" aria-labelledby="tiers_filter_types-ts-label" tabindex="0">
<input class="items-placeholder" tabindex="-1" placeholder="">
<div class="clear-button" title="Supprimer tous les éléments sélectionnés">⨯</div>
</div>
<div class="ts-dropdown multi plugin-dropdown_input plugin-remove_button plugin-clear_button" style="display: none;">
<div class="dropdown-input-wrap"><input type="select-multiple" autocomplete="off" size="1" tabindex="-1" class="dropdown-input"></div>
<div role="listbox" tabindex="-1" class="ts-dropdown-content" id="tiers_filter_types-ts-dropdown" aria-labelledby="tiers_filter_types-ts-label"></div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="mb-3"><label for="tiers_filter_nom" class="form-label">Nom</label><input type="text" id="tiers_filter_nom" name="tiers_filter[nom]" class="form-control"> </div>
</div>
</div>
<div class="row">
<div class="col-3">
<div class="mb-3 form-switch" style="height: 30px;">
<div class="form-check"><input type="checkbox" id="tiers_filter_withCosu" name="tiers_filter[withCosu]" class="form-check-input form-check-input" value="1">
<label class="form-check-label" for="tiers_filter_withCosu">Inclure les archivés</label>
</div>
</div>
</div>
<div class="col"></div>
</div>
</div>
<div class="card-footer">
<div class="d-flex justify-content-between flex-row-reverse">
<button type="submit" id="tiers_filter_filter_data" name="tiers_filter[filter_data]" data-session-ignore="data-session-ignore" class="btn btn-primary ms-auto btn"><i class="fas fa-search me-1"></i>Filtrer</button>
<button type="submit" id="tiers_filter_reset" name="tiers_filter[reset]" data-session-ignore="data-session-ignore" class="btn btn-warning reset-cookie-form-action btn"><i class="fas fa-eraser me-1"></i>Effacer filtre</button>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" id="tiers_filter__token" name="tiers_filter[_token]" value="3d4.opRwh5IK6qmaAwzIQLfH0fgyAYE6DPzVO-7lmw9tE2Y.86Mozd1OjfqjTEeYM9bzubZta-VbXLCfC96QzVUaYTfL3zTs30iu29NmNA">
</form>
</div> |
Replying in the new PR. |
Description
Customers mentioned, that it would be much more comfortable, if they could click the entire card header.
So not only the arrow icon, but also the entire title and whitespace in between:
I have to agree, they are not wrong.
WDYT @cavasinf ?
Types of changes
Checklist