Skip to content

Commit 0b3be74

Browse files
committed
fix(Input): qa prop assignment
1 parent aafa0d5 commit 0b3be74

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

src/components/forms/Checkbox/Checkbox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,14 @@ function Checkbox(
228228
isHidden={isHidden}
229229
mods={mods}
230230
styles={{ position: 'relative' }}
231+
qa="CheckboxWrapper"
231232
>
232233
<HiddenInput
233234
data-qa="HiddenInput"
234235
{...mergeProps(inputProps, focusProps)}
235236
ref={inputRef}
236237
/>
237-
<CheckboxElement qa={qa || 'Checkbox'} mods={mods} styles={inputStyles}>
238+
<CheckboxElement qa="Checkbox" mods={mods} styles={inputStyles}>
238239
{markIcon}
239240
</CheckboxElement>
240241
{children && <Text nowrap>{children}</Text>}

src/components/forms/TextInput/TextInputBase.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ function _TextInputBase(props: CubeTextInputBaseProps, ref) {
341341
const textField = (
342342
<InputWrapperElement
343343
ref={wrapperRef}
344-
qa={qa || 'TextInput'}
344+
qa="TextInput"
345345
mods={modifiers}
346346
data-size={size}
347347
styles={wrapperStyles}

src/components/pickers/ComboBox/ComboBox.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
BLOCK_STYLES,
2222
extractStyles,
2323
OUTER_STYLES,
24+
Props,
2425
tasty,
2526
} from '../../../tasty';
2627
import { useFocus } from '../../../utils/react/interactions';
@@ -116,6 +117,7 @@ export interface CubeComboBoxProps<T>
116117
/** An optional keyboard delegate implementation, to override the default. */
117118
keyboardDelegate?: KeyboardDelegate;
118119
loadingState?: LoadingState;
120+
wrapperProps?: Props;
119121
/**
120122
* The filter function used to determine if a option should be included in the combo box list.
121123
* Has no effect when `items` is provided.
@@ -179,6 +181,7 @@ export const ComboBox = forwardRef(function ComboBox<T extends object>(
179181
filter,
180182
styles,
181183
labelSuffix,
184+
wrapperProps,
182185
...otherProps
183186
} = props;
184187

@@ -333,16 +336,17 @@ export const ComboBox = forwardRef(function ComboBox<T extends object>(
333336
let comboBoxField = (
334337
<ComboBoxWrapperElement
335338
ref={wrapperRef}
336-
qa={qa || 'ComboBox'}
339+
qa="ComboBoxWrapper"
337340
{...modAttrs(mods)}
338341
styles={outerStyles}
339342
style={{
340343
zIndex: isFocused ? 1 : 'initial',
341344
}}
342345
data-size={size}
346+
wrapperProps={wrapperProps}
343347
>
344348
<InputElement
345-
qa="Input"
349+
qa="ComboBoxInput"
346350
{...mergeProps(inputProps, hoverProps, focusProps)}
347351
ref={inputRef}
348352
autoComplete={autoComplete}

src/components/pickers/Select/Select.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export interface CubeSelectBaseProps<T>
267267
inputProps?: Props;
268268
type?: 'secondary' | 'clear' | 'primary' | (string & {});
269269
suffixPosition?: 'before' | 'after';
270+
wrapperProps?: Props;
270271
}
271272

272273
export interface CubeSelectProps<T> extends CubeSelectBaseProps<T> {
@@ -328,6 +329,7 @@ function Select<T extends object>(
328329
labelSuffix,
329330
ellipsis,
330331
suffixPosition = 'before',
332+
wrapperProps,
331333
...otherProps
332334
} = props;
333335
let state = useSelectState(props);
@@ -414,12 +416,13 @@ function Select<T extends object>(
414416

415417
let selectField = (
416418
<SelectWrapperElement
417-
qa={qa || 'Select'}
419+
qa="SelectWrapper"
418420
mods={modifiers}
419421
styles={outerStyles}
420422
data-size={size}
421423
data-type={type}
422424
data-theme={theme}
425+
wrapperProps={wrapperProps}
423426
>
424427
<HiddenSelect
425428
state={state}
@@ -430,6 +433,7 @@ function Select<T extends object>(
430433
<SelectElement
431434
{...mergeProps(buttonProps, hoverProps, focusProps)}
432435
ref={triggerRef}
436+
qa="Select"
433437
styles={inputStyles}
434438
data-theme={theme}
435439
data-size={size}

0 commit comments

Comments
 (0)