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

Fix for ipad #640

Closed
wants to merge 74 commits into from
Closed

Fix for ipad #640

wants to merge 74 commits into from

Conversation

danilaramaniuk2378
Copy link

@danilaramaniuk2378 danilaramaniuk2378 commented Jun 20, 2017

Switch is working with bugs on real devices (for example iPad).

To fix we can put

onClick: this._getValue() ? this._handleOnClick.bind(this) : this._handleOffClick.bind(this)

in params in _renderLabel function. Is it make sense?

Julusian and others added 30 commits August 29, 2015 22:55
Tests and example are broken
Trim out unused documentation
…gleState respectively

- Fix issues with disabled, readonly, handleWidth and labelWidth
In the off state, if you click on the label the switch does not toggle.
 This is because the offset is non-zero, which makes the difference
non-zero, which makes switch behave as if it’s been dragged to the off
state.

The fix is to only calculate the state based on the difference if the
switch was dragged.  And it’s only dragged if the mouse has moved at
some point after the initial dragStart.

I took a look at the original bootstrap switch and it’s how it behaves
too.
When using the switch, I get a massive height.  It’s the same as the
issue reported here:
Bttstrp#360

As I understand it, height specifies the height of an element relative
to its parent container, so 100% is the same height as its parent.
http:https://www.w3.org/TR/CSS21/visudet.html#propdef-height

However, I think it makes sense for a switch to be defined by its
internal height (as dictated by its size / content).
Fix two bugs.  One with the toggle behavior of the switch, and one with the height of the switch.
Previously when the state prop changed due to an update in the parent component, the switch would not toggle to the correct position.  Now, with the use of componentWillReceiveProps, we pass the state prop to the value() method so it can be updated.  This will probably work with other, currently immutable props.
In Safari, even with the opacity set to zero, the unfocused ON state `onColor` is only shown as a small square in the upper left hand corner of the on switch. Setting the checkbox visibility to `hidden` fixes the issue.
captainstarfish and others added 26 commits September 16, 2016 12:41
_updateContainerPosition should care about handleWidth 'auto' value to
prevent error `NaN` is an invalid value for the `marginLeft` css style property
Allow to onText and offText to be a component
This patch fixes the PropTypes warning and closes #40.
@graingert
Copy link
Collaborator

Can you rebase this correctly?

@graingert
Copy link
Collaborator

?

@danilaramaniuk2378
Copy link
Author

@graingert I do not sure that I understand how to rebase it. I created this PR not in the right repo, I have this issue in react-bootstrap-switch and not in bootstrap-switch

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

Successfully merging this pull request may close these issues.

None yet

9 participants