Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1419600

    When using the date picker form input field on mobile, the phone default keyboard appears and hides the date picker

    See: https://ibb.co/BBBfbFN

    I believe this can be resolved to stop the keyboard from appearing using the following code but this should be fixed in the theme:

    <input type="text" inputmode="none" />

    Source:

    Please advise

    ps.
    I am not getting any notification emails of topic updates despite checking the box – Notify me of follow-up replies via email

    • This topic was modified 1 year, 3 months ago by IconicD.
    • This topic was modified 1 year, 3 months ago by IconicD.
    #1419647

    Hey IconicD,

    Thank you for the info.

    We will forward the issue to our channel. For the meantime, please add this code in the functions.php file to apply the inputmode attribute to the datepicker.

    function av_custom_inline_script() {
            // apply inputmode to datepicker
    	wp_add_inline_script( 'jquery', 
    		"
    		(function($) {
                        $('.avia_datepicker').each(function() {
                            $(this).attr('inputmode', 'none'); 
                        });
                    })(jQuery);
    		"
    	);
         }
    add_action( 'wp_enqueue_scripts', 'av_custom_inline_script' );
    

    Best regards,
    Ismael

    #1419715

    Have you tested this code on one of your installs?

    Unfortunately, it doesn’t work for me on Chrome/Android.

    #1419717

    Hi,

    Please try using the code as the following:

    
    function av_custom_inline_script()
    {
        // apply inputmode to datepicker
        wp_add_inline_script( 'jquery', 
        "
        (function($) {
                $('.avia_datepicker').attr('inputmode', 'none'); 
    
                $('body').on('av_resize_finished', function() {
                    $('.avia_ajax_form + .ajaxresponse').scrollTo(-50);
                });
        })(jQuery);
        "
        );
    }
    add_action( 'wp_enqueue_scripts', 'av_custom_inline_script' );
    

    Our developers addressed this issue and the fix will be included in the upcoming version.

    Best regards,
    Yigit

    #1419725

    Also is there a way to display the date picker calendar on screen rather than having it show via pop up?

    #1419729

    Great. The last code is working now.

    One other issue on mobile that needs fixing is that after submitting the form the ‘Your Message Has Been Sent!’ success message is hidden above from the visitor as it disappears off the screen.

    #1419814

    Hey!

    ‘Your Message Has Been Sent!’ success message is hidden above from the visitor as it disappears off the screen.

    We slightly modified the script above. Please try it again.

    // https://kriesi.at/support/topic/date-picker-form-issue-mobile/#post-1419717

    Regards,
    Ismael

    #1419961

    The updated code with the -50 scroll seems to have broken the keyboard display fix. Please check your end.

    I can live without the success message by forwarding to a new URL after submission so feel free to give me the previous code that fixed the keyboard issue.

    • This reply was modified 1 year, 2 months ago by IconicD.
    #1419995

    Hi,

    Thank you for the update.

    The changes should not have affected the previous script. Please make sure to copy the code directly from the forum, not from your email. This is the previous script without the scrollTo changes.

    function av_custom_inline_script()
    {
        // apply inputmode to datepicker
        wp_add_inline_script( 'jquery', 
        "
        (function($) {
                $('.avia_datepicker').attr('inputmode', 'none'); 
        })(jQuery);
        "
        );
    }
    add_action( 'wp_enqueue_scripts', 'av_custom_inline_script' );

    Best regards,
    Ismael

    #1422003

    try that instead:

    function remove_text_input_mode_on_datepicker(){
    ?>
    <script type = "text/javascript">
    window.addEventListener("DOMContentLoaded", function () { 
    	(function($){
    		$('.avia_datepicker').each(function() {
    			$(this).attr('readonly','readonly');
    		});  
    	})(jQuery);
    });
    </script>
    <?php
    }
    add_action( 'wp_footer', 'remove_text_input_mode_on_datepicker', 20 );
    #1422097

    So – it seems to work with the attribute of Ismael, just not when you insert it there afterwards via script.
    It must be hardcoded in the class-form-generator.php ;)

    the attribute readonly works even if you add it via script.

    #1422106

    Hi,

    the attribute readonly works even if you add it via script.


    @Guenni007
    : Thank you for the info. Hope it helps the user.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.