22
22
23
23
< ion-content id ="content ">
24
24
< h5 class ="ion-padding-start ion-padding-top "> Search - Default </ h5 >
25
- < ion-searchbar id ="basic " value ="test " type ="tel " show-cancel-button debounce ="500 ">
25
+ < ion-searchbar id ="basic " value ="test " type ="tel " show-cancel-button =" focus " debounce ="500 ">
26
26
</ ion-searchbar >
27
27
28
28
< h5 class ="ion-padding-start ion-padding-top "> Search - No Cancel Button </ h5 >
29
- < ion-searchbar id ="noCancel " value ="after view " autocorrect ="off " autocomplete ="off " spellcheck ="true " type ="text " show-cancel-button ="false ">
29
+ < ion-searchbar id ="noCancel " value ="after view " autocorrect ="off " autocomplete ="off " spellcheck ="true " type ="text " show-cancel-button ="never ">
30
30
</ ion-searchbar >
31
-
31
+
32
32
< h5 class ="ion-padding-start ion-padding-top "> Search - Always Show Cancel Button</ h5 >
33
33
< ion-searchbar id ="noCancel " value ="after view " animated ="true " show-cancel-button ="always ">
34
34
</ ion-searchbar >
35
-
35
+
36
36
< h5 class ="ion-padding-start ion-padding-top "> Search - Never Show Cancel Button</ h5 >
37
37
< ion-searchbar id ="noCancel " value ="after view " animated ="true " show-cancel-button ="never ">
38
38
</ ion-searchbar >
39
-
39
+
40
40
< h5 class ="ion-padding-start ion-padding-top "> Search - Show Cancel Button on Focus</ h5 >
41
41
< ion-searchbar id ="noCancel " value ="after view " animated ="true " show-cancel-button ="focus ">
42
42
</ ion-searchbar >
43
43
44
44
< h5 class ="ion-padding-start ion-padding-top "> Search - Cancel Button set to false</ h5 >
45
- < ion-searchbar id ="noCancel " value ="after view " autocorrect ="off " autocomplete ="off " spellcheck ="true " type ="text " show-cancel-button ="false ">
45
+ < ion-searchbar id ="noCancel " value ="after view " autocorrect ="off " autocomplete ="off " spellcheck ="true " type ="text " show-cancel-button ="never ">
46
46
</ ion-searchbar >
47
-
47
+
48
48
< h5 class ="ion-padding-start ion-padding-top "> Search - Cancel Button set to true</ h5 >
49
- < ion-searchbar id ="noCancel " value ="after view " autocorrect ="off " autocomplete ="off " spellcheck ="true " type ="text " show-cancel-button ="true ">
49
+ < ion-searchbar id ="noCancel " value ="after view " autocorrect ="off " autocomplete ="off " spellcheck ="true " type ="text " show-cancel-button ="focus ">
50
50
</ ion-searchbar >
51
51
52
52
< h5 class ="ion-padding-start ion-padding-top "> Search - Disabled </ h5 >
53
53
< ion-searchbar id ="disabled " value ="disabled " type ="text " disabled ="true ">
54
54
</ ion-searchbar >
55
55
56
56
< h5 class ="ion-padding-start ion-padding-top "> Search - Danger </ h5 >
57
- < ion-searchbar color ="danger " show-cancel-button >
57
+ < ion-searchbar color ="danger " show-cancel-button =" focus " >
58
58
</ ion-searchbar >
59
59
60
60
< h5 class ="ion-padding-start ion-padding-top "> Search - Custom Search Icon </ h5 >
61
- < ion-searchbar search-icon ="home " show-cancel-button debounce ="500 ">
61
+ < ion-searchbar search-icon ="home " show-cancel-button =" focus " debounce ="500 ">
62
62
</ ion-searchbar >
63
63
64
64
< h5 class ="ion-padding-start ion-padding-top "> Search - Animated </ h5 >
65
- < ion-searchbar animated ="true " show-cancel-button debounce ="500 ">
65
+ < ion-searchbar animated ="true " show-cancel-button =" focus " debounce ="500 ">
66
66
</ ion-searchbar >
67
67
68
68
< h5 class ="ion-padding-start ion-padding-top "> Search - Custom Placeholder </ h5 >
69
- < ion-searchbar id ="dynamicProp " value ="33 " autocorrect ="on " show-cancel-button ="true " autocomplete ="on " spellcheck ="false "
69
+ < ion-searchbar id ="dynamicProp " value ="33 " autocorrect ="on " show-cancel-button ="focus " autocomplete ="on " spellcheck ="false "
70
70
type ="number " placeholder ="Filter Schedules ">
71
71
</ ion-searchbar >
72
72
73
73
< h5 class ="ion-padding-start ion-padding-top "> Search - Custom Cancel Button Danger </ h5 >
74
- < ion-searchbar show-cancel-button cancel-button-text ="Really Long Cancel " color ="danger ">
74
+ < ion-searchbar show-cancel-button =" focus " cancel-button-text ="Really Long Cancel " color ="danger ">
75
75
</ ion-searchbar >
76
76
77
77
< h5 class ="ion-padding-start ion-padding-top "> Search - Value passed </ h5 >
78
- < ion-searchbar value ="mysearch " cancel-button-text ="Really Long Cancel " color ="dark " show-cancel-button >
78
+ < ion-searchbar value ="mysearch " cancel-button-text ="Really Long Cancel " color ="dark " show-cancel-button =" focus " >
79
79
</ ion-searchbar >
80
80
81
81
< h5 class ="ion-padding-start ion-padding-top "> Search - Mode iOS</ h5 >
82
- < ion-searchbar mode ="ios " animated ="true " show-cancel-button placeholder ="Search ">
82
+ < ion-searchbar mode ="ios " animated ="true " show-cancel-button =" focus " placeholder ="Search ">
83
83
</ ion-searchbar >
84
84
85
85
< h5 class ="ion-padding-start ion-padding-top "> Search - Mode MD</ h5 >
86
- < ion-searchbar mode ="md " animated ="true " show-cancel-button placeholder ="Search ">
86
+ < ion-searchbar mode ="md " animated ="true " show-cancel-button =" focus " placeholder ="Search ">
87
87
</ ion-searchbar >
88
88
89
89
< h5 class ="ion-padding-start ion-padding-top "> Search - DebounceTime </ h5 >
90
- < ion-searchbar autocorrect ="on " show-cancel-button ="true " autocomplete ="on " spellcheck ="true " type ="text " debounce ="5000 "
90
+ < ion-searchbar autocorrect ="on " show-cancel-button ="focus " autocomplete ="on " spellcheck ="true " type ="text " debounce ="5000 "
91
91
placeholder ="Check the log ">
92
92
</ ion-searchbar >
93
93
94
94
< h5 class ="ion-padding-start ion-padding-top "> Search - Animated and No Cancel</ h5 >
95
- < ion-searchbar id ="dynamicAttr " placeholder ="Search " animated ="true " show-cancel-button ="false ">
95
+ < ion-searchbar id ="dynamicAttr " placeholder ="Search " animated ="true " show-cancel-button ="never ">
96
96
</ ion-searchbar >
97
97
98
98
< p class ="ion-padding ">
@@ -117,17 +117,17 @@ <h5 class="ion-padding-start ion-padding-top"> Search - Animated and No Cancel</
117
117
// Toggle animated attribute
118
118
const attrIsAnimated = dynamicAttr . getAttribute ( 'animated' ) === 'true' ? false : true ;
119
119
dynamicAttr . setAttribute ( 'animated' , attrIsAnimated ) ;
120
-
120
+
121
121
// Toggle show-cancel-button attribute
122
122
let attrShowCancel ;
123
123
const showCancelValue = dynamicAttr . getAttribute ( 'show-cancel-button' ) ;
124
-
124
+
125
125
switch ( showCancelValue ) {
126
- case true :
126
+ case true :
127
127
case "true" :
128
128
attrShowCancel = false ;
129
129
break ;
130
- case false :
130
+ case false :
131
131
case "false" :
132
132
attrShowCancel = 'always' ;
133
133
break ;
@@ -142,7 +142,7 @@ <h5 class="ion-padding-start ion-padding-top"> Search - Animated and No Cancel</
142
142
attrShowCancel = true ;
143
143
break ;
144
144
}
145
-
145
+
146
146
dynamicAttr . setAttribute ( 'show-cancel-button' , attrShowCancel ) ;
147
147
148
148
// Toggle placeholder attribute
0 commit comments