File tree 1 file changed +13
-5
lines changed
platform/nativescript/renderer
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -96,12 +96,20 @@ export default class ViewNode {
96
96
try {
97
97
if ( XML_ATTRIBUTES . indexOf ( key ) !== - 1 ) {
98
98
this . nativeView . _applyXmlAttribute ( key , value )
99
- } else if ( isAndroid && key . startsWith ( 'android:' ) ) {
100
- set ( this . nativeView , key . replace ( 'android:' , '' ) , value )
101
- } else if ( isIOS && key . startsWith ( 'ios:' ) ) {
102
- set ( this . nativeView , key . replace ( 'ios:' , '' ) , value )
103
99
} else {
104
- set ( this . nativeView , key , value )
100
+ // detect expandable attrs for boolean values
101
+ // See https://vuejs.org/v2/guide/components-props.html#Passing-a-Boolean
102
+ if ( typeof this . nativeView [ key ] === 'boolean' && value === '' ) {
103
+ value = true
104
+ }
105
+
106
+ if ( isAndroid && key . startsWith ( 'android:' ) ) {
107
+ set ( this . nativeView , key . replace ( 'android:' , '' ) , value )
108
+ } else if ( isIOS && key . startsWith ( 'ios:' ) ) {
109
+ set ( this . nativeView , key . replace ( 'ios:' , '' ) , value )
110
+ } else {
111
+ set ( this . nativeView , key , value )
112
+ }
105
113
}
106
114
} catch ( e ) {
107
115
// ignore
You can’t perform that action at this time.
0 commit comments