materialize icon indicating copy to clipboard operation
materialize copied to clipboard

select multiple close on ipad

Open philipraets opened this issue 11 years ago • 11 comments

if you open a multiple select on an ipad, you can select multiple options, but it is not possible to close it unless you open another select or set focus on an input field

philipraets avatar Nov 17 '15 12:11 philipraets

Hi,

I don't have issue on my iPad, can you itemize your environnement ?

Tim-arts avatar Nov 17 '15 13:11 Tim-arts

I just went to http://materializecss.com and tried the different selects on ipad. The "normal" ones I can close by tapping on a disabled option, but the multiple select stays open. Also if you just tap outside the selects, the selects stay open.

This is on an ipad retina with ios 9.1

On android, they close if you tap outside the selects.

philipraets avatar Nov 19 '15 08:11 philipraets

Yes, I've reproduced this on my iPad, I'm thinking we need to add some event listener for tap or look for some way to support touch device defocuses.

acburst avatar Nov 24 '15 01:11 acburst

This issue is still happening, it works fine on Android but iOS will not tap off.

rossrankin avatar Nov 25 '16 10:11 rossrankin

The tap out is only reacting to click events which doesn't seem to be fired on iPad/iPhone. This seems to work if you add a touchstart event handler or "redirect" touchstart to click (that is, fire a click event on touchstart events).

Thanood avatar Nov 25 '16 11:11 Thanood

I have the same issue on iOS. Do you have any update about it ?

lodow avatar Jan 27 '17 11:01 lodow

There's no proper fix but you can add the class 'browser default' to the input to get it working.

This is explained about 1/3 of the way down this page: http://materializecss.com/forms.html

rossrankin avatar Jan 27 '17 13:01 rossrankin

Can anyone check if this issue is still present inv0.99.0?

tomscholz avatar Jul 08 '17 19:07 tomscholz

Yes, this issue is still present in v0.99.0.

guicara avatar Aug 03 '17 11:08 guicara

Hey guys this code should fix the problem with multiple select and closing it on iOS devices.

 $(document).on('touchstart', function (e) {
        let target = $(e.target);
        if (!target.is("span")) { //checking if you are tapping on items in multiple select or not
            $(document).trigger('click'); //if you are tapping outside multiple select close it
            $(':focus').blur(); //focus out for multiple select so you can choose another or the same (in case you have more multiple selects on page)
        } else {
            //nothing or fire another event
        };
    });

This works for me.

sokolmarek avatar Aug 13 '17 20:08 sokolmarek

Fixed in v1-dev

Dogfalo avatar Feb 10 '18 02:02 Dogfalo