{% set value = post[ name ] ?? '' %}
{% do setBulleFiltre(name, label, value) %}
<div class="relative">
    {% set eventHandler = 
        'bulleFiltreAdd('
        ~ [
            path('Ajax.SessionCreation.bulleFiltre') | json,
            name | json, label| json,
            'this.value',
            '() => {ajaxRechercheTableau('
            ~ [
                path(getRouteName(), getRouteAttr()) | json,
                form_id | json, form_id | json,
            ] | join(',')
            ~ ')}'
        ] | join(',')
        ~ ');' 
    %}
    <input type="text" {{ attr(
        (inputAttr ?? []) 
        | merge({
            name: name,
            class: 'form-control form-control-sm datepicker',
            value: value,
            onchange: eventHandler,
            onkeypress:
                'if(event.keyCode=="13"){'
                ~ eventHandler
                ~ ' event.preventDefault();'
                ~ '}'
        }) 
    ) }} />
</div>