B2theRandino / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

Toggle form element not working on iOS5 #323

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. On Mobile Safari using iOS 5
2. Open an iUI webpage with a toggle element
3. Press toggle Element: nothing happens

What is the expected output? What do you see instead?
Normally, toggle should switch from "on" to "off". It doesn't on Mobile Safari 
iOS5.
Note that it works as expected on desktop Safari, Firefox, Blackberry 7 & 
Playbook.

Original issue reported on code.google.com by remi.gru...@gmail.com on 9 Jan 2012 at 4:29

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
can be tested here: 
http://we-are-gurus.com/labs/iui/issues/323/
Bug seems to occur only on iOS 5, but with all releases of iUI.

It does work again when adding onclick=";" on toggle div

Original comment by remi.gru...@gmail.com on 9 Jan 2012 at 4:34

GoogleCodeExporter commented 8 years ago
in the same time, i've always thought toggle should generate an hidden input 
checkbox with value to 'on' with name equal to toggle id attribute...

Original comment by remi.gru...@gmail.com on 9 Jan 2012 at 4:54

GoogleCodeExporter commented 8 years ago
I thought toggles should be two-value selects: "on" / "off" (etc).  That way  
we can use the names for the CSS.

Maybe we should also adopt iOS 5 round styling.

Original comment by msgilli...@gmail.com on 9 Jan 2012 at 5:25

GoogleCodeExporter commented 8 years ago
two-value select might be a good idea too, but what i had in mind with checkbox 
was a data-iui-toggle attribute (i know you love attributes!) to hide it & 
replace it by toggle. Note that this could be done too with a select, but since 
toggle is a true/false UI element, a checkbox came first to my mind.

Want me to code something for this? 
I'd go:
- detect toggles
- create on/off select for each using "toggle"+i (as i toggle number) if no id 
attribute is set
- hide the select
- add select value switch when user taps toggle

This way we stay compatible with existing iUI projects. Perhaps go with the 
select iui attribute with 0.5
Thoughts ?

Since a onclick event would be set on toggle elements to do so, that would 
solve this issue in the same time...

Original comment by remi.gru...@gmail.com on 9 Jan 2012 at 5:47

GoogleCodeExporter commented 8 years ago
Do you know what is causing the toggle not to work in iOS 5?  Why does adding 
onclick=";" fix it?

IMO: In 0.4 let's just fix the bug and leave things as divs/spans.  In 0.5 we 
can implement checkboxes and/or selects.

Original comment by msgilli...@gmail.com on 17 Jan 2012 at 10:38

GoogleCodeExporter commented 8 years ago
Yes, it's because there is no js event on it, neither href.

Add an empty href or an onclick=";", it will then work.

That's buggy iOS5's Safari for you!

Remi

iOS5

adding onclick=";" fix it?

0.5 we can implement checkboxes and/or selects.

Original comment by remi.gru...@gmail.com on 17 Jan 2012 at 10:55

GoogleCodeExporter commented 8 years ago
OK, I implemented checkboxes as a test:
http://code.google.com/r/msgilligan-iui-dev/source/detail?r=f56361e83e349c73518f
84ac46dfa523c1b8eaab&name=msgilligan-togglefixes

and I now think checkbox is a better way of doing it than select.  We're 
tracking that change using Issue #212, btw.

Original comment by msgilli...@gmail.com on 18 Jan 2012 at 12:29

GoogleCodeExporter commented 8 years ago
Is that a bug in iOS 5 Safari or a feature?  Is there a fix we can make to 
iui.js to make existing sites work without modifying the div.toggle?

Original comment by msgilli...@gmail.com on 18 Jan 2012 at 12:32