[Due for payment 2026-11-14] [$175] Report title-Report title field accept multiline text
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: undefined Reproducible in staging?: Yes Reproducible in production?: yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/Expensify/issues/572854 Email or phone of affected tester (no customers): Issue reported by: Applause Internal Team Bug source: Device used: App Component:
Action Performed:
- Open the app.
- Go to workspace settings > Reports.
- Click Default report title.
- Enter multiline text with some mark down.
Expected Result:
default report title field should accept only single line title
Actual Result:
it accepts multiline text in default report title
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/7c6f1add-bbf9-438d-acb8-762cae583efa
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022113291405478224182
- Upwork Job ID: 2113291405478224182
- Last Price Increase: 2026-10-22
Issue Owner
Current Issue Owner: @mallenexpensify
Proposal
Please re-state the problem that we are trying to solve in this issue.
The workspace Default report title field lets you press Enter and save a title with line breaks. It should accept a single line only.
What is the root cause of that problem?
The input uses autoGrowHeight, which turns it into a multiline textarea. Because of that, Enter inserts a new line instead of submitting the form, and nothing removes line breaks before the title is saved.
ReportsDefaultTitle.tsx:131-140setsautoGrowHeightandmaxAutoGrowHeight.BaseTextInput/implementation/index.tsx:325treatsautoGrowHeightas multiline.ReportsDefaultTitle.tsx:84passes the value tosetPolicyDefaultReportTitleunchanged.
History
- feat: [ORTF] Auto reporting frequency made this field an auto-growing textarea on purpose, so long formulas wrap. Nobody discussed allowing new lines.
- [Due for payment 2025-12-04] [$250] Reports - Default report title field accepts multiline title and renders mark down reported the same problem. Its fix, fix: Reports - Default report title field accepts multiline title and renders mark down, removed only the markdown rendering and kept multiline input on purpose. So the new-line part was never fixed.
- Let single-field edit input grow to reduce wasted white space later added an
autoGrowSingleLineprop for exactly this case.
What changes do you think we should make in order to solve the problem?
Use the same pattern as the report title edit page, EditReportFieldText.tsx. All changes are in ReportsDefaultTitle.tsx:
- Replace
autoGrowHeightandmaxAutoGrowHeightwithautoGrowSingleLine. The text still wraps, but Enter submits the form instead of adding a new line (InputWrapper.tsx:50). - In
submitForm, convert line breaks to spaces withStringUtils.lineBreaksToSpacesbefore saving, because pasted text can still contain them.EditReportFieldText.tsxdoes the same. - Run
validateCustomNameon the converted value. - Optional: apply
lineBreaksToSpacestocustomNameDefaultValuetoo, so titles already saved with line breaks show as one line.
What alternative solutions did you explore? (Optional)
- Remove auto-grow entirely. This is simpler, but long formulas would scroll sideways again, which undoes the approved design from the ORTF PR.
- Strip new lines in
onChangeText. Enter would do nothing, and the cursor could jump.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104758) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Workspace settings > Reports > Default report title, the input accepts multiline text. Pressing Enter, or pasting text with line breaks, inserts new lines into the title template. The default report title should be a single-line value.
What is the root cause of that problem?
I couldn't confirm this against the source, and Kimi's analysis was empty, so this is from my recollection of the code. The Default report title page (src/pages/workspace/rules/RulesCustomNamePage.tsx) renders its TextInput through InputWrapper with multiline and autoGrowHeight (and markdown highlighting) enabled. This lets long formulas wrap. A multiline TextInput on web is a <textarea>, which allows newline characters from both Enter and paste. Nothing in the form's validate or onSubmit strips or rejects \n, so the stored customName can contain line breaks.
What changes do you think we should make in order to solve the problem?
- In
RulesCustomNamePage.tsx, make the input single-line by removingmultiline,autoGrowHeightandmaxAutoGrowHeight. Keep the other props (isMarkdownEnabled,maxLength, label and so on). A single-line input (<input type="text">on web, a single-lineTextInputon native) rejects Enter and strips line breaks on paste. Enter then triggers the form's submit viaonSubmitEditing.
<InputWrapper
InputComponent={TextInput}
inputID={INPUT_IDS.CUSTOM_NAME}
label={translate('workspace.rules.expenseReportRules.customNameInputLabel')}
aria-label={translate('workspace.rules.expenseReportRules.customNameInputLabel')}
role={CONST.ROLE.PRESENTATION}
ref={inputCallbackRef}
defaultValue={customName}
maxLength={CONST.WORKSPACE_REPORT_FIELD_POLICY_MAX_LENGTH /* keep the existing limit */}
// removed: multiline, autoGrowHeight, maxAutoGrowHeight
/>
- As defense in depth, normalize the value on submit so that no
\nor\rcan be saved from any path, such as old drafts or other clients:
const sanitizedName = values[INPUT_IDS.CUSTOM_NAME].replace(/[\r\n]+/g, ' ').trim();
Policy.setPolicyDefaultReportTitle(policyID, sanitizedName);
- If product wants long formulas to keep wrapping visually, use the alternative below instead of step 1.
What alternative solutions did you explore? (Optional)
- Keep
multilineandautoGrowHeight, and strip newlines inonChangeTextwithsubmitBehavior="submit". This keeps visual wrapping, but it is more complex.InputWrapperandFormProvidermanage the value, so sanitizing means making the input controlled. It also adds platform-specific Enter handling. I would only use it if wrapping is required. - Add a validation error when the value contains a newline. This is worse UX than preventing the input, since the user can't type or paste the character in the first place. It's also unnecessary once the input is single-line.
Testing
- Go to Workspace settings > Reports > Default report title.
- Press Enter in the field. No new line should be inserted, and the form should submit.
- Paste multi-line text (for example
Line1\nLine2 **bold**). The newlines should be removed or collapsed and the text should appear on one line. - Save and reopen the page. The saved title should be a single line, and a report using the title should render correctly.
- Verify on web (Chrome), iOS and Android, and check that a long title still respects
maxLengthand remains editable. - Add a unit test (or a UI test) that the submit handler strips
\nand\rfrom the value before calling the policy action.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (External)
Job added to Upwork: https://www.upwork.com/jobs/~022113291405478224182
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0170d6b02e9440e604
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Workspace settings > Reports > Default report title, the title input field accepts multiline text (hitting Enter creates a newline in the input and line breaks are saved into the default report title). The field should only accept a single-line title.
What is the root cause of that problem?
In src/pages/workspace/reports/ReportsDefaultTitle.tsx:131-140:
<InputWrapper
InputComponent={TextInput}
role={CONST.ROLE.PRESENTATION}
inputID={INPUT_IDS.DEFAULT_TITLE}
defaultValue={customNameDefaultValue}
label={translate('workspace.reports.customNameInputLabel')}
aria-label={translate('workspace.reports.customNameInputLabel')}
maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
spellCheck={false}
autoFocus
autoGrowHeight
ref={(el: BaseTextInputRef | null): void => {
if (!isInputInitializedRef.current) {
updateMultilineInputRange(el);
}
isInputInitializedRef.current = true;
}}
/>
ReportsDefaultTitle.tsxconfigures the input withautoGrowHeightandmaxAutoGrowHeight.- In
BaseTextInput/implementation/index.tsx:325,autoGrowHeightturns the input into a multiline input (multiline: true, which renders a<textarea>on Web). - In a multiline input, pressing the Enter key inserts a
\ncharacter rather than submitting the form. - Furthermore, in
submitForm(line 84),values.defaultTitleis passed directly tosetPolicyDefaultReportTitlewithout normalizing line breaks (\r\n), so pasted multiline text or entered newlines are permanently saved into policy settings. - In contrast,
EditReportFieldText.tsx(the canonical implementation for editing report field titles and report names, PR #97489) usesautoGrowSingleLineandStringUtils.lineBreaksToSpaces(values[fieldKey]).
What changes do you think we should make in order to solve the problem?
Align ReportsDefaultTitle.tsx with the pattern established in EditReportFieldText.tsx:
1. In src/pages/workspace/reports/ReportsDefaultTitle.tsx:
- Replace
autoGrowHeightandmaxAutoGrowHeightwithautoGrowSingleLine. This allows long title formulas to wrap smoothly without turning the field into a multiline<textarea>. Pressing Enter immediately submits the form. - In
validateCustomNameandsubmitForm, sanitize the title usingStringUtils.lineBreaksToSpacesbefore validation and persistence so that pasted text containing line breaks is collapsed into spaces:
--- a/src/pages/workspace/reports/ReportsDefaultTitle.tsx
+++ b/src/pages/workspace/reports/ReportsDefaultTitle.tsx
@@ -20,6 +20,7 @@ import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import {getTitleErrorField, hasCircularReferences, isTitleEmpty} from '@libs/PolicyUtils';
+import StringUtils from '@libs/StringUtils';
import {clearPolicyDefaultReportTitleError, setPolicyDefaultReportTitle} from '@userActions/Policy/Policy';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
@@ -51,7 +52,8 @@ function ReportsDefaultTitle({route}: ReportsDefaultTitleProps) {
const customNameDefaultValue = getReportNameValue();
const validateCustomName = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM> => {
- const defaultTitle = values.defaultTitle?.trim();
+ const defaultTitle = StringUtils.lineBreaksToSpaces(values.defaultTitle).trim();
const errors: FormInputErrors<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM> = {};
if (isTitleEmpty(defaultTitle)) {
errors.defaultTitle = translate('common.error.fieldRequired');
@@ -82,7 +84,8 @@ function ReportsDefaultTitle({route}: ReportsDefaultTitleProps) {
});
const submitForm = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM>) => {
- setPolicyDefaultReportTitle(policyID, values.defaultTitle, policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE], getReviewWorkspaceSettingsTaskCompletion());
+ const sanitizedTitle = StringUtils.lineBreaksToSpaces(values.defaultTitle).trim();
+ setPolicyDefaultReportTitle(policyID, sanitizedTitle, policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE], getReviewWorkspaceSettingsTaskCompletion());
Navigation.goBack();
};
@@ -131,10 +134,9 @@ function ReportsDefaultTitle({route}: ReportsDefaultTitleProps) {
defaultValue={customNameDefaultValue}
label={translate('workspace.reports.customNameInputLabel')}
aria-label={translate('workspace.reports.customNameInputLabel')}
- maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
+ autoGrowSingleLine
spellCheck={false}
autoFocus
- autoGrowHeight
ref={(el: BaseTextInputRef | null): void => {
if (!isInputInitializedRef.current) {
updateMultilineInputRange(el);
Why this solution is optimal:
- Architectural Parity: Matches
EditReportFieldText.tsx:103exactly, following the design decision from PR #97489 ("Let single-field edit input grow to reduce wasted white space"). - Best UX: Long formulas (e.g.
{report:type} - {field:Client Name} - {date:YYYY-MM-DD}) still visually wrap without expanding into an unbounded textarea, while hitting Enter triggers instant submission. - Pasting Protection:
StringUtils.lineBreaksToSpacesguarantees that multiline text copied from external editors is sanitized into a single-line string.
What alternative solutions did you explore? (Optional)
- Completely removing
autoGrowSingleLineand using a static single-line input: Rejected. Workspace default report titles frequently contain multiple formula tokens ({workspace:name},{report:submitter},{date:YYYY-MM}), which quickly exceed the single-line width.autoGrowSingleLineprovides the ideal balance between single-line semantics and visual formula readability.
What automated tests can you add to prevent this from re-occurring?
In tests/unit/ReportsDefaultTitleTest.tsx:
- Render
ReportsDefaultTitle. - Submit the form with multiline input:
"Report Title\nWith\nNewlines". - Assert
setPolicyDefaultReportTitleis called with"Report Title With Newlines". - Verify pressing Enter triggers form submission.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/hamzakhanbuic
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Workspace settings > Reports > Default report title, the title input field accepts multiline text. Pressing Enter inserts a newline instead of submitting the form, and line breaks are saved into the default report title. The field should only accept single-line input.
What is the root cause of that problem?
-
Incorrect Multiline Configuration on
InputWrapper(ReportsDefaultTitle.tsx:131–140):<InputWrapper InputComponent={TextInput} role={CONST.ROLE.PRESENTATION} inputID={INPUT_IDS.DEFAULT_TITLE} defaultValue={customNameDefaultValue} label={translate('workspace.reports.customNameInputLabel')} aria-label={translate('workspace.reports.customNameInputLabel')} maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight} spellCheck={false} autoFocus autoGrowHeight ref={(el: BaseTextInputRef | null): void => { if (!isInputInitializedRef.current) { updateMultilineInputRange(el); } isInputInitializedRef.current = true; }} />The field sets
autoGrowHeight, which configuresTextInputas a multiline textarea (multiline={true}). PerInputWrapper.tsx:48–50, true multiline inputs reserve the Enter key for inserting newlines rather than submitting the form. -
Missing Normalization for Pasted Line Breaks (
ReportsDefaultTitle.tsx:83–86):submitFormpassesvalues.defaultTitledirectly tosetPolicyDefaultReportTitlewithout sanitizing line breaks, allowing pasted multiline text to be persisted to Onyx and backend storage.
What changes do you think we should make in order to solve the problem?
Adopt the exact established pattern from src/pages/EditReportFieldText.tsx:
1. In src/pages/workspace/reports/ReportsDefaultTitle.tsx:
- Replace
autoGrowHeightandmaxAutoGrowHeightwithautoGrowSingleLine. As documented inInputWrapper.tsx:48–50:"autoGrowSingleLine inputs only render as multi-line so their value can wrap - a new line is never a valid value there, so nothing has to be reserved for inserting one and the return key always submits." This preserves visual wrapping for long title formulas/variables while enforcing single-line Enter-to-submit semantics.
- In
validateCustomNameandsubmitForm, normalize the title withStringUtils.lineBreaksToSpacesbefore validation and persistence so that pasted text containing line breaks is collapsed into spaces. - Apply
StringUtils.lineBreaksToSpacestocustomNameDefaultValueto normalize any legacy values saved with line breaks. - Remove
updateMultilineInputRangeandisInputInitializedRefsince multiline selection range manipulation is no longer required for single-line inputs.
--- a/src/pages/workspace/reports/ReportsDefaultTitle.tsx
+++ b/src/pages/workspace/reports/ReportsDefaultTitle.tsx
@@ -21,7 +21,7 @@ import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavig
import type {SettingsNavigatorParamList} from '@libs/Navigation/types';
import {getTitleFieldWithFallback} from '@libs/ReportUtils';
-import updateMultilineInputRange from '@libs/updateMultilineInputRange';
+import StringUtils from '@libs/StringUtils';
import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper';
-import variables from '@styles/variables';
-
import {clearPolicyTitleFieldError, setPolicyDefaultReportTitle} from '@userActions/Policy/Policy';
import CONST from '@src/CONST';
@@ -46,7 +44,6 @@ function ReportsDefaultTitlePage({route}: RulesCustomNamePageProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const getReviewWorkspaceSettingsTaskCompletion = useReviewWorkspaceSettingsTaskCompletion();
- const isInputInitializedRef = useRef(false);
const RULE_EXAMPLE_BULLET_POINTS = [
translate('workspace.reports.customNameEmailPhoneExample'),
translate('workspace.reports.customNameStartDateExample'),
@@ -56,15 +53,16 @@ function ReportsDefaultTitlePage({route}: RulesCustomNamePageProps) {
] as const satisfies string[];
const titleField = getTitleFieldWithFallback(policy);
- const customNameDefaultValue = Str.htmlDecode(titleField?.defaultValue ?? '');
+ const customNameDefaultValue = StringUtils.lineBreaksToSpaces(Str.htmlDecode(titleField?.defaultValue ?? ''));
const validateCustomName = useCallback(
({defaultTitle}: FormOnyxValues<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM>) => {
const errors: FormInputErrors<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM> = {};
- if (!defaultTitle) {
+ const sanitizedTitle = StringUtils.lineBreaksToSpaces(defaultTitle).trim();
+ if (!sanitizedTitle) {
errors[INPUT_IDS.DEFAULT_TITLE] = translate('common.error.fieldRequired');
- } else if (defaultTitle.length > CONST.REPORT_TITLE_FORMULA_LIMIT) {
- errors[INPUT_IDS.DEFAULT_TITLE] = translate('common.error.characterLimitExceedCounter', defaultTitle.length, CONST.REPORT_TITLE_FORMULA_LIMIT);
+ } else if (sanitizedTitle.length > CONST.REPORT_TITLE_FORMULA_LIMIT) {
+ errors[INPUT_IDS.DEFAULT_TITLE] = translate('common.error.characterLimitExceedCounter', sanitizedTitle.length, CONST.REPORT_TITLE_FORMULA_LIMIT);
}
return errors;
},
@@ -81,7 +79,8 @@ function ReportsDefaultTitlePage({route}: RulesCustomNamePageProps) {
});
const submitForm = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.REPORTS_DEFAULT_TITLE_MODAL_FORM>) => {
- setPolicyDefaultReportTitle(policyID, values.defaultTitle, policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE], getReviewWorkspaceSettingsTaskCompletion());
+ const sanitizedTitle = StringUtils.lineBreaksToSpaces(values.defaultTitle).trim();
+ setPolicyDefaultReportTitle(policyID, sanitizedTitle, policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE], getReviewWorkspaceSettingsTaskCompletion());
Navigation.goBack();
};
@@ -128,16 +127,9 @@ function ReportsDefaultTitlePage({route}: RulesCustomNamePageProps) {
defaultValue={customNameDefaultValue}
label={translate('workspace.reports.customNameInputLabel')}
aria-label={translate('workspace.reports.customNameInputLabel')}
- maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
spellCheck={false}
autoFocus
- autoGrowHeight
- ref={(el: BaseTextInputRef | null): void => {
- if (!isInputInitializedRef.current) {
- updateMultilineInputRange(el);
- }
- isInputInitializedRef.current = true;
- }}
+ autoGrowSingleLine
/>
</OfflineWithFeedback>
Key Advantages:
- Preserves Visual Text Wrapping Without Newlines: Unlike removing auto-grow entirely (which causes long templates like
{report:type} - {user:email} - {date:startDate}to scroll horizontally off-screen),autoGrowSingleLineallows the text to wrap cleanly within the input view while retaining single-line submit behavior. - Defensive Normalization: Pasted text containing newlines is automatically converted to spaces, matching
EditReportFieldText.tsx. - Clean Codebase: Removes unused refs and imports (
updateMultilineInputRange,variables).
What alternative solutions did you explore? (Optional)
- Disabling auto-grow entirely (removing
autoGrowHeightwithout replacing withautoGrowSingleLine):- Rejected because default report title templates often contain long variable formulas. Forcing a standard rigid single-line input causes templates to truncate and scroll sideways, degrading the editing experience.
- Blocking submission with an error when newlines are present:
- Rejected. Normalizing newlines into spaces on paste is standard across Expensify and avoids user frustration when copying templates from emails or external docs.
What specific scenarios should we cover in automated tests to prevent reintroduction of this issue in the future?
In tests/unit/ReportsDefaultTitlePageTest.tsx:
- Enter Key Submission:
- Verify that
InputWrapperrenders withautoGrowSingleLine={true}and pressing Enter triggerssubmitForm.
- Verify that
- Pasted Newline Sanitization:
- Submit a title containing multiple newlines (e.g.
"Monthly\nReport\nExpenses"). - Assert that
setPolicyDefaultReportTitleis called with"Monthly Report Expenses".
- Submit a title containing multiple newlines (e.g.
- Empty String After Trim:
- Submit a string containing only newlines and whitespace (e.g.
"\n \n"). - Assert that
validateCustomNameproducesfieldRequirederror.
- Submit a string containing only newlines and whitespace (e.g.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~015055563b6090af39
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Workspace settings > Reports > Default report title, the input field accepts multiline text. Pressing Enter or pasting multiline text inserts line breaks into the report title template, but default report title should only accept a single line.
What is the root cause of that problem?
In src/pages/workspace/reports/ReportsDefaultTitle.tsx, InputWrapper is configured with autoGrowHeight, maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}, and calls updateMultilineInputRange(el) in its ref callback.
Because autoGrowHeight is set to true on the underlying TextInput, it renders as a multiline input that dynamically expands and allows users to enter newlines. Furthermore, there is no validation in validateCustomName preventing line breaks.
What changes do you think we should make in order to solve the problem?
- In
src/pages/workspace/reports/ReportsDefaultTitle.tsx:- Remove
autoGrowHeight,maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}, and the multilinerefcallback fromInputWrapper. - Remove unused imports
updateMultilineInputRange,variables, andisInputInitializedRef.
- Remove
- To prevent users from pasting multiline text:
- In
validateCustomName, add validation to reject inputs containing newline characters (\nor\r), or sanitize the input insubmitFormby stripping/replacing line breaks with spaces. - Explicitly pass
multiline={false}toInputWrapper.
- In
What alternative solutions did you explore? (Optional)
N/A
📣 @fangjian-bit! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Accepting Melvin's proposal. Root cause is correct, autoGrowHeight makes the default report title a multiline input, so Enter inserts a line break and submitForm saves that value unchanged. autoGrowSingleLine is the right fix: long formulas still wrap, and Enter submits the form. Flatten line breaks with StringUtils.lineBreaksToSpaces before validating and saving, as EditReportFieldText does.
Please include these details in the implementation:
- Validate and save
StringUtils.lineBreaksToSpaces(value).trim(). Use that string for both the required check and theREPORT_TITLE_FORMULA_LIMITcheck. A newline-only value becomes spaces, so the currentif (!defaultTitle)check would accept it. - Apply the same flattening to
customNameDefaultValue, afterStr.htmlDecode, so a title already saved with line breaks opens as one line. - Keep the existing
autoFocusprop andupdateMultilineInputRangeref.autoGrowSingleLinestill renders a multiline input, and that ref places the caret at the end of an existing formula.maxAutoGrowHeightcan be removed;autoGrowSingleLinealready defaults it.
🎀👀🎀
Triggered auto assignment to @NicolasBonet, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Contributor details
⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.
Contributor details
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
I agree @rojiphil