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

Prevent Default on Ctrl + Backspace in ReactFlow #706

Merged
merged 12 commits into from
Aug 14, 2023

Conversation

Cristhianzl
Copy link
Collaborator

Fixes the issue where using Ctrl + Backspace in ReactFlow caused unwanted default behavior. This pull request addresses the problem by preventing the default action when the user presses Ctrl + Backspace, allowing for a smoother and more intuitive experience when interacting with the application.

🐛 fix(App.tsx): prevent default behavior of Ctrl+Backspace key combination to improve user experience
🐛 fix(AccordionComponent/index.tsx): prevent default behavior of Backspace key to improve user experience
🐛 fix(floatComponent/index.tsx): prevent default behavior of Backspace key to improve user experience
🐛 fix(inputComponent/index.tsx): prevent default behavior of Backspace key to improve user experience
🐛 fix(inputListComponent/index.tsx): prevent default behavior of Ctrl+Backspace key combination to improve user experience
🐛 fix(intComponent/index.tsx): prevent default behavior of Backspace key to improve user experience
🐛 fix(genericModal/index.tsx): prevent default behavior of Backspace key to improve user experience

…ation to improve user experience

🐛 fix(AccordionComponent/index.tsx): prevent default behavior of Backspace key to improve user experience

🐛 fix(floatComponent/index.tsx): prevent default behavior of Backspace key to improve user experience

🐛 fix(inputComponent/index.tsx): prevent default behavior of Backspace key to improve user experience

🐛 fix(inputListComponent/index.tsx): prevent default behavior of Ctrl+Backspace key combination to improve user experience

🐛 fix(intComponent/index.tsx): prevent default behavior of Backspace key to improve user experience

🐛 fix(genericModal/index.tsx): prevent default behavior of Backspace key to improve user experience
🐛 fix(frontend): remove unnecessary merge conflict markers in reactflowUtils.ts file
@Cristhianzl Cristhianzl marked this pull request as draft August 2, 2023 02:22
@Cristhianzl Cristhianzl marked this pull request as ready for review August 2, 2023 02:22
@Cristhianzl Cristhianzl marked this pull request as draft August 2, 2023 02:28
@Cristhianzl
Copy link
Collaborator Author

Waiting for definitions to finish the Pull Request.

…+backspace event

The code related to preventing the control+backspace event in the application was removed as it was no longer needed.
@Cristhianzl Cristhianzl marked this pull request as ready for review August 2, 2023 14:53
anovazzi1 and others added 3 commits August 2, 2023 21:27
…and improve code semantics

feat(reactflowUtils.ts): add getConnectedNodes function to retrieve connected nodes based on an edge
fix(styleUtils.ts): remove unused getConnectedNodes function
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

not working yet, great improvement, but when using ctrl-backspace on whitespace the node is deleted.

…on of keyboard event when pressing Ctrl + Backspace on input value that matches block or ends with a space character to improve user experience
@Cristhianzl
Copy link
Collaborator Author

not working yet, great improvement, but when using ctrl-backspace on whitespace the node is deleted.

Could you please double-check if everything is alright now?

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

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

The bug is still happening.
Please test using the following steps:

  • Drop a PromptTemplate
  • Duplicate it a few times
  • Open one, write something and hit CTRL+backspace 2 times.
  • You'll have one less PromptTemplate on screen.

…characters in strings

🔧 fix(reactflowUtils.ts): update handleKeyDown function to prevent deletion of block when a special character is the last character in the input value
@Cristhianzl
Copy link
Collaborator Author

The bug is still happening. Please test using the following steps:

  • Drop a PromptTemplate
  • Duplicate it a few times
  • Open one, write something and hit CTRL+backspace 2 times.
  • You'll have one less PromptTemplate on screen.

Please, kindly reevaluate to confirm if the bug has been resolved at this point.

Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

worked as a charm

…event in handleKeyDown function

🐛 fix(reactflowUtils.ts): fix handleKeyDown function to properly handle special characters and backspace key
@Cristhianzl Cristhianzl changed the base branch from dev to release August 14, 2023 19:40
@ogabrielluiz ogabrielluiz merged commit 9df5e94 into release Aug 14, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants