Open grappler opened 5 years ago
When using these two configurations I get an JS error in the console: Uncaught TypeError: data.value.split is not a function
Uncaught TypeError: data.value.split is not a function
[ 'label' => esc_html__( 'Zoom', 'static-map' ), 'attr' => 'zoom', 'type' => 'select', 'options' => range( 1, 22 ), ], [ 'label' => esc_html__( 'Zoom', 'static-map' ), 'attr' => 'zoom', 'type' => 'select', 'options' => array_combine( range( 0, 22 ), range( 0, 22 ) ), ],
The reason for this is that the data.value has a typeof number instead of string in these cases.
data.value
typeof
If I change the code to the following it works fine.
[ 'label' => esc_html__( 'Zoom', 'static-map' ), 'attr' => 'zoom', 'type' => 'select', 'options' => array_combine( range( 1, 22 ), range( 1, 22 ) ), ],
Related change https://github.com/wp-shortcake/shortcake/pull/745
When using these two configurations I get an JS error in the console:
Uncaught TypeError: data.value.split is not a function
The reason for this is that the
data.value
has atypeof
number instead of string in these cases.If I change the code to the following it works fine.
Related change https://github.com/wp-shortcake/shortcake/pull/745