question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: On ion-toggle, toggle-inner does not adapt to height and width

See original GitHub issue

Bug Report

Ionic version:

[x] 4.10

Current behavior:

We can change height and width of a ion-toggle but toggle-inner does not adapt the respective height and width

Here is the styling that I am using:

<ion-toggle #onOffToggle mode='ios'></ion-toggle>
ion-toggle {
		--background: var(--color-red);
		--background-checked: var(--color-green);
		height: 20px;
		width: 50px;
	}

image

Expected behavior:

Inner circle should adapt to the respective height

Also by some way can I make toogle look like this? image

Steps to reproduce:

<ion-toggle #onOffToggle mode=‘ios’></ion-toggle>

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.2
   Ionic Framework               : @ionic/angular 4.10.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 5 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.9

System:

   Android SDK Tools : 26.1.1 (C:\Program Files\Android\android-sdk)
   NodeJS            : v12.13.0 (C:\Program Files\nodejs\node.exe)
   npm               : 6.12.0
   OS                : Windows 10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rajiramamoorthicommented, Nov 29, 2019

Any solution for the above issue

3reactions
C-rackercommented, Nov 20, 2019

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

On ion-toggle, toggle-inner does not adapt to height and width ...
Looks good, one bug I've found is in "md" mode you can't override the handle background when the toggle is checked. It always...
Read more >
Ion-toggle size Ionic4 - Ionic Forum
Hello,. I'm desperate to change the size of a toggle (width: 100%;). the handle is blocked. Does anyone have a solution?
Read more >
ion-toggle : Reduce size of toggle button - Stack Overflow
track class to adjust following css properties: width: 51px; height: 31px;. and then .toggle .handle to adjust following css properties: width ...
Read more >
A Knob Trick For Ion-Toggle and Ion-Range - Level Up Coding
This is a small article about leveraging the CSS “background” ... I did remove width='512' height='512' from the SVG source as Safari is...
Read more >
@ionic/core | Yarn - Package Manager
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found