Skip to content
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

Time Picker not working in Safari #384

Open
bernardbaker opened this issue Oct 10, 2018 · 3 comments
Open

Time Picker not working in Safari #384

bernardbaker opened this issue Oct 10, 2018 · 3 comments

Comments

@bernardbaker
Copy link

I'm working with the Time Picker in Safari and it doesn't work correctly.

In Chrome it is working fine.

$(function(){
	var elements = document.querySelectorAll("input[data-name='time-picker-01']")
	for(var i = 0; i < elements.length; i++) {
		$('#'+elements[i].getAttribute('id')).timepicker({
			minuteStep: 1,
			template: false,
			appendWidgetTo: 'body',
			showSeconds: false,
			showMeridian: false,
			defaultTime: false,
			disableFocus: true
		});

		$('#'+elements[i].getAttribute('id')).timepicker().on('changeTime.timepicker', function(e) {
			var event = new CustomEvent('changeTime.timepicker',
			{
				payload: {
					hours: e.time.hours,
					minutes: e.time.minutes
				}
			})
            document.dispatchEvent(event)
		});
	}
})
@juanfranem
Copy link

same here!

@ntkhang0910
Copy link

ntkhang0910 commented Jan 16, 2019

        if (window.navigator.userAgent.indexOf("Safari") != -1) {
          var index_highest = 0;
          $(".modal").each(function () {
            // always use a radix when using parseInt
            var index_current = parseInt($(this).css("zIndex"), 10);
            if (index_current > index_highest) {
              index_highest = index_current;
            }
          });
          zIndex = parseInt(this.$element.parents().filter(function () { return $(this).css('z-index') !== 'auto'; }).first().css('z-index'), 10) + index_highest;
        }

add in file boostrap-timepicker.js below line "var zIndex = parseInt(this.$element.parents().filter(function () { return $(this).css('z-index') !== 'auto'; }).first().css('z-index'), 10) + 10;"

@luqmanrom
Copy link

I added this styles and it fixes the problem so far

 .bootstrap-timepicker-widget {
            z-index: 1060 !important;
            display: block !important;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants