ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ion-content setting overflow-scroll="{{conditional()}}" not working

Open bwalsh opened this issue 12 years ago • 7 comments

Attempting to set overflow-scroll conditionally, depending if we are running in desktop browser or not. This code works, if you inspect the element, you see overflow-scroll="true". However, the behavior is not there (scrolling doesn't work) However, if I simply hard code overflow-scroll="true" it works fine?

bwalsh avatar Oct 24 '14 16:10 bwalsh

This will soon be a global configuration, and the attribute is currently receiving an overhaul. cc/ @perrygovier

Ionitron avatar Jan 25 '15 06:01 Ionitron

+1 I have the same issue here

Elsioufy avatar Aug 20 '15 15:08 Elsioufy

+1

kderbalah avatar Aug 20 '15 15:08 kderbalah

Instead of that, you could do this.

.config(function($ionicConfigProvider){
   if(condition1) {
    $ionicConfigProvider.scrolling.jsScrolling(false)
  } else {
    $ionicConfigProvider.scrolling.jsScrolling(true)
  }
});

Or in a controller

.controller('MainCtrl', function($ionicConfig){
    $ionicConfig.scrolling.jsScrolling(false)
});

mhartington avatar Aug 20 '15 15:08 mhartington

@mhartington I have an older version of ionic, jsScrolling requires updating ionic and upgrading requires doing a lot of changes to match the new ionic version, is there any workarounds for overflow-scroll to work as a conditional attribute?

Elsioufy avatar Aug 23 '15 09:08 Elsioufy

Unfortunately no, there isn't.

mhartington avatar Aug 23 '15 14:08 mhartington

+1 :(

jdnichollsc avatar Jul 04 '16 16:07 jdnichollsc