[streams-platform] Strange issue while adding form on front end

lckamal - 2 months ago

I am adding a form like so:

{% set contactForm = form('leads', 'contacts').entry(contact).redirect('sales/contacts').get() %}
          {{ contactForm.open|raw }}
            {% for field in contactForm.fields %}
              {{ field|raw }}
            {% endfor %}
            <div class="form-group">
              <input class="btn btn-primary" type="submit" name="submit" value="{{ trans('theme::site.submit') }}"/>
            {{ contactForm.close|raw }}

There is one boolean field which switch is based on admin theme. I have a ajax call on every 20sec to load new notifications. When the ajax is called css for field is loaded and design looks good. Here is screencast for the issue: http://take.ms/nqLn7 Any idea?

On page load: http://take.ms/whmgg After ajax call: http://take.ms/SPUnd0

May be because of this? http://take.ms/Ofs7X on app/default/assets/core/anomaly/boolean-field_type/resources/js/input.js?v=1485338512

$(document).on('ajaxComplete ready', function () {

    setTimeout(function () {

        // Initialize form switches
        $('[data-provides="anomaly.field_type.boolean"]:not([data-initialized])').each(function () {

                .attr('data-initialized', '')

    }, 10);

Same issue on other multiselect field type

ryanthompson - 2 months ago

Is your javascript deferred or included in the foot? Either way can you try changing it's position just for testing purposes? If it's in the head - move it to the bottom and vice versa.

lckamal - 2 months ago

All javascript are in footer. All css are in header.

ryanthompson - 2 months ago

Can you verify the input CSS is being loaded?