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

Tap on checkbox text - IOS #125

Open
kriefsacha opened this issue Mar 23, 2020 · 2 comments
Open

Tap on checkbox text - IOS #125

kriefsacha opened this issue Mar 23, 2020 · 2 comments

Comments

@kriefsacha
Copy link

kriefsacha commented Mar 23, 2020

Hi,

I work with radio buttons with the plugin version 1.0.0 on nativescript angular 6.

On android when you click on the text of the radio button , it's choosing it.

On IOS it's not working. You need to tap on the radio button to change your choice.

That's pretty problematic, if you have a fix please. Thanks !

@joost-leisink
Copy link

Working with nativescript Vue and facing the same issue.
It seems there is no fix so we have to build our own 'hybrid' solution with a checkbox and tappabe label?

@markosole
Copy link

markosole commented Jul 3, 2021

Same problem here, the label text would change it's opacity meaning it's pressed but it does not trigger status.
I am going to add transparent layer (grid layout allows that) and use as a button to trigger / change status in the JS.

Not perfect but it will do the job.

Here is example:

JS code:

function forceCheckBox(){
    if(viewModel.snizeniSwitch == 1){
        viewModel.set("snizeniSwitch", false);
    } else {
        viewModel.set("snizeniSwitch", true);
    }
}

XML View:

<GridLayout row="0" columns="100,*" rows="35" marginTop="5">
    <!-- Platform specific view -->
    <Android><CheckBox:CheckBox fillColor="white" color="white" col="0" marginLeft="7" marginTop="5" row="0" horizontalAlignment="left" class="filter-label" checked="{{ snizeniSwitch }}" text="Sniženi" id="myCheckbox"/></Android>
    <iOS>
        <CheckBox:CheckBox fillColor="white" tintColor="white" onCheckColor="red" onTintColor="white" onFillColor="white" color="white" col="0" marginLeft="7" marginTop="8" paddingBottom="5" row="0" horizontalAlignment="left" class="filter-label" checked="{{ snizeniSwitch }}" text="Sniženi" id="myCheckbox"/>

        <StackLayout row="0" col="0" width="50" heigh="10" marginLeft="12" tap="forceCheckBox">
            <!-- This is empty and used only as a transparent button  -->
        </StackLayout>
    </iOS>
</GridLayout>

*Checkbox is white and you can customize color, but for test use it on top of any element with background != white
iOS version is wrapped in and will be displayed only on iOS platform.

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

3 participants