{% extends 'forms/base_widget.html' %}

{% block html %}
    <div class="typeahead__container i-form-field-fixed-width" data-tooltip-anchor>
        <div class="typeahead__field">
            <input id="{{ field.id }}" autocomplete="off" class="typeahead" type="text" name="{{ field.name }}"
                   {%- if field.data is not none -%}value="{{ field._value() }}"{%- endif -%}>
        </div>
    </div>
{% endblock %}

{% block javascript %}
    <script>
        (function() {
            'use strict';

            var field = $('#{{ field.id }}');
            var params = {
                hint: true,
                mustSelectItem: true,
                minLength: {{ min_trigger_length }},
                source: {
                    data: {{ choices | tojson }}
                }
            };

            {% if search_url %}
                $.extend(true, params, {
                    dynamic: true,
                    source: {
                        url: [{
                            url: {{ search_url | tojson }},
                            data: {
                                q: {% raw %}'{{query}}'{% endraw %}
                            }
                        }]
                    }
                });
            {% endif %}

            field.typeahead($.extend(true, params, {{ options | tojson }}));
        })();
    </script>
{% endblock %}

{% extends 'forms/base_widget.html' %}

{% block html %}
    <div class="typeahead__container i-form-field-fixed-width" data-tooltip-anchor>
        <div class="typeahead__field">
            <input id="{{ field.id }}" autocomplete="off" class="typeahead" type="text" name="{{ field.name }}"
                   {%- if field.data is not none -%}value="{{ field._value() }}"{%- endif -%}>
        </div>
    </div>
{% endblock %}

{% block javascript %}
    <script>
        (function() {
            'use strict';

            var field = $('#{{ field.id }}');
            var params = {
                hint: true,
                cancelButton: false,
                mustSelectItem: true,
                minLength: {{ min_trigger_length }},
                source: {
                    data: {{ choices | tojson }}
                }
            };

            {% if search_url %}
                $.extend(true, params, {
                    dynamic: true,
                    source: {
                        url: [{
                            url: {{ search_url | tojson }},
                            data: {
                                q: {% raw %}'{{query}}'{% endraw %}
                            }
                        }]
                    }
                });
            {% endif %}

            field.typeahead($.extend(true, params, {{ options | tojson }}));
        })();
    </script>
{% endblock %}

Disable cancel button in typeahead widget
Disable cancel button in typeahead widget
