Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Inconsistency while pasting highlighted mention in room description #42361

Merged
merged 5 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,8 @@ const CONST = {
* @deprecated Please stop using the accessibilityRole prop and use the role prop instead.
*/
IMAGE: 'image',

TEXTBOX: 'textbox',
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give me a small explanation why this will fix the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we use isMarkdownEnabled: true, the activeElementRole in here is textbox, so shouldDisableEnterShortcut in here is false, that why pressing on enter does not add a new line. So we need to make sure when the markdown input is focused, shouldDisableEnterShortcut is true, by adding texbox to CONST.ACCESSIBILITY_ROLE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shubham1206agra Can you help check it?

},
/**
* Acceptable values for the `role` attribute on react native components.
Expand Down
1 change: 1 addition & 0 deletions src/pages/RoomDescriptionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) {
value={description}
onChangeText={handleReportDescriptionChange}
autoCapitalize="none"
isMarkdownEnabled
/>
</View>
</FormProvider>
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceNewRoomPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ function WorkspaceNewRoomPage({policies, reports, formState, session, activePoli
maxLength={CONST.REPORT_DESCRIPTION.MAX_LENGTH}
autoCapitalize="none"
shouldInterceptSwipe
isMarkdownEnabled
/>
</View>
<View style={[styles.mhn5]}>
Expand Down
Loading