Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/TextPicker/TextSelectorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function TextSelectorModal({
customValidate,
enabledWhenOffline = true,
allowHTML,
shouldUseStrictHtmlTagValidation = false,
autoGrowHeight,
...rest
}: TextSelectorModalProps) {
Expand Down Expand Up @@ -164,6 +165,7 @@ function TextSelectorModal({
addBottomSafeAreaPadding
enterKeyEventListenerPriority={0}
allowHTML={allowHTML}
shouldUseStrictHtmlTagValidation={shouldUseStrictHtmlTagValidation}
shouldValidateOnBlur={!isClosing}
>
{!!subtitle && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/TextPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function TextPicker({
interactive = true,
required = false,
customValidate,
shouldUseStrictHtmlTagValidation,
wrapperStyle,
numberOfLinesTitle,
titleStyle,
Expand Down Expand Up @@ -80,6 +81,7 @@ function TextPicker({
disabled={disabled}
required={required}
customValidate={customValidate}
shouldUseStrictHtmlTagValidation={shouldUseStrictHtmlTagValidation}
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
/>
Expand Down
6 changes: 6 additions & 0 deletions src/components/TextPicker/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type TextSelectorModalProps = {

/** Whether HTML is allowed in form inputs */
allowHTML?: boolean;

/** Whether to use strict HTML tag validation regex */
shouldUseStrictHtmlTagValidation?: boolean;
} & Pick<MenuItemBaseProps, 'subtitle' | 'description'> &
Omit<TextProps, 'ref'>;

Expand Down Expand Up @@ -81,6 +84,9 @@ type TextPickerProps = {
/** Whether HTML is allowed in form inputs */
allowHTML?: boolean;

/** Whether to use strict HTML tag validation regex */
shouldUseStrictHtmlTagValidation?: boolean;

/** Reference to the outer element */
ref?: ForwardedRef<View>;
} & Pick<MenuItemBaseProps, 'rightLabel' | 'subtitle' | 'description' | 'interactive' | 'wrapperStyle' | 'numberOfLinesTitle' | 'titleStyle' | 'descriptionTextStyle'> &
Expand Down
2 changes: 2 additions & 0 deletions src/pages/workspace/reports/CreateReportFieldsPage.tsx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot Why changes in CreateReportField page? Is this related to tax?

Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ function WorkspaceCreateReportFieldsPage({
enabledWhenOffline
shouldValidateOnBlur={false}
addBottomSafeAreaPadding
shouldUseStrictHtmlTagValidation
>
{({inputValues}) => (
<View style={styles.mhn5}>
Expand All @@ -198,6 +199,7 @@ function WorkspaceCreateReportFieldsPage({
role={CONST.ROLE.PRESENTATION}
required
customValidate={validateName}
shouldUseStrictHtmlTagValidation
/>
<InputWrapper
InputComponent={TypeSelector}
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/taxes/NamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function NamePage({
validate={validate}
shouldHideFixErrorsAlert
addBottomSafeAreaPadding
shouldUseStrictHtmlTagValidation
>
<View style={styles.mb4}>
<InputWrapper
Expand Down
2 changes: 2 additions & 0 deletions src/pages/workspace/taxes/WorkspaceCreateTaxPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function WorkspaceCreateTaxPage({
enabledWhenOffline
shouldValidateOnBlur={false}
addBottomSafeAreaPadding
shouldUseStrictHtmlTagValidation
>
<View style={styles.mhn5}>
<InputWrapper
Expand All @@ -112,6 +113,7 @@ function WorkspaceCreateTaxPage({
role={CONST.ROLE.PRESENTATION}
required
customValidate={customValidateForName}
shouldUseStrictHtmlTagValidation
/>
<InputWrapper
InputComponent={AmountPicker}
Expand Down
Loading