File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
packages/calcite-components/src/components/input-time-zone Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -103,4 +103,21 @@ describe("calcite-input-time-zone", () => {
103
103
104
104
expect ( await timeZoneItem . getProperty ( "textLabel" ) ) . toMatch ( "GMT-6" ) ;
105
105
} ) ;
106
+
107
+ it ( "does not allow users to deselect a timezone offset" , async ( ) => {
108
+ const page = await newE2EPage ( ) ;
109
+ await page . emulateTimezone ( "America/Los_Angeles" ) ;
110
+ await page . setContent ( html `< calcite-input-time-zone value ="-360 " open > </ calcite-input-time-zone > ` ) ;
111
+ await page . waitForChanges ( ) ;
112
+
113
+ let selectedTimeZoneItem = await page . find ( "calcite-input-time-zone >>> calcite-combobox-item[selected]" ) ;
114
+ await selectedTimeZoneItem . click ( ) ;
115
+ await page . waitForChanges ( ) ;
116
+
117
+ selectedTimeZoneItem = await page . find ( "calcite-input-time-zone >>> calcite-combobox-item[selected]" ) ;
118
+ const input = await page . find ( "calcite-input-time-zone" ) ;
119
+
120
+ expect ( await input . getProperty ( "value" ) ) . toBe ( "-360" ) ;
121
+ expect ( await selectedTimeZoneItem . getProperty ( "textLabel" ) ) . toMatch ( "GMT-6" ) ;
122
+ } ) ;
106
123
} ) ;
Original file line number Diff line number Diff line change @@ -138,13 +138,6 @@ export class InputTimeZone
138
138
*/
139
139
@Prop ( { mutable : true } ) value : string ;
140
140
141
- @Watch ( "value" )
142
- valueWatcher ( value : string ) : void {
143
- if ( this . comboboxEl && this . comboboxEl . value !== value ) {
144
- this . comboboxEl . value = value ;
145
- }
146
- }
147
-
148
141
//--------------------------------------------------------------------------
149
142
//
150
143
// Public Methods
@@ -316,7 +309,7 @@ export class InputTimeZone
316
309
open = { this . open }
317
310
overlayPositioning = { this . overlayPositioning }
318
311
scale = { this . scale }
319
- selectionMode = "single"
312
+ selectionMode = "single-persist "
320
313
// eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)
321
314
ref = { this . setComboboxRef }
322
315
>
You can’t perform that action at this time.
0 commit comments