-
Notifications
You must be signed in to change notification settings - Fork 58
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
[4285] Fix direct edit when the palette is closed #4316
base: master
Are you sure you want to change the base?
Conversation
8ad2c42
to
784af1c
Compare
784af1c
to
57aec8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something somewhere in this PR is breaking the behavior of the palette in multiple use cases, I can't reopen a closed palette, some behavior like the delete is only working half the time.
if ((event.altKey && key === 'Alt') || (event.shiftKey && key === 'Shift') || isTextField || readOnly) { | ||
return; | ||
} | ||
/*If the palette is opened, do nothing*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1- Why?
2- This does not work, it only works half the time so why?
Why can't I click an edge and use the key Delete
to delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you open the palette you have the focus on the searchfield input and as such we want to keep the use of the Delete
key to manipulate the text in the field.
You have to close the palette to Delete the element or click a tool.
return; | ||
} | ||
|
||
/*When the palette is opened, allow direct edit only with F2 so we can type in the palette search field*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why break the existing behavior that has worked for years on both desktop and web?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even that does not work properly, I can successfully bypass it sometimes to restore the original behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's comparable with the desktop version. Here when we open the palette we want to have the focus on the searchfield input and as such we can use direct edit only with F2 if the palette is opened.
If the palette is closed then F2 or typing can be used to start the direct edit.
Do you mean the direct-edit is starting when typing on the searchfield with the PR?
packages/diagrams/frontend/sirius-components-diagrams/src/renderer/palette/Palette.tsx
Show resolved
Hide resolved
652bd5d
to
c24f5a5
Compare
I made several changes to the PR :
Also note that we have an issue with the tabindex of the quicktools that use the Tool.tsx component and as such pressing tab does not produce the expected result when selecting quicktools. |
Bug: #4285 Signed-off-by: Michaël Charfadi <[email protected]>
c24f5a5
to
d4d8acc
Compare
Bug: #4285
Pull request template
General purpose
What is the main goal of this pull request?
Project management
priority:
andpr:
labels been added to the pull request? (In case of doubt, start with the labelspriority: low
andpr: to review later
)area:
,difficulty:
,type:
)CHANGELOG.adoc
been updated to reference the relevant issues?CHANGELOG.adoc
? (Including changes in the GraphQL API)CHANGELOG.adoc
? For example indoc/screenshots/2022.5.0-my-new-feature.png
Architectural decision records (ADR)
[doc]
?CHANGELOG.adoc
?Dependencies
CHANGELOG.adoc
?CHANGELOG.adoc
?Frontend
This section is not relevant if your contribution does not come with changes to the frontend.
General purpose
Typing
We need to improve the typing of our code, as such, we require every contribution to come with proper TypeScript typing for both changes contributing new files and those modifying existing files.
Please ensure that the following statements are true for each file created or modified (this may require you to improve code outside of your contribution).
useMutation<DATA_TYPE, VARIABLE_TYPE>(…)
useQuery<DATA_TYPE, VARIABLE_TYPE>(…)
useSubscription<DATA_TYPE, VARIABLE_TYPE>(…)
useMachine<CONTEXT_TYPE, EVENTS_TYPE>(…)
useState<STATE_TYPE>(…)
?.
(if the GraphQL API specifies that a field cannot benull
, do not treat it has potentiallynull
for example)let diagram: Diagram | null = null;
)Backend
This section is not relevant if your contribution does not come with changes to the backend.
General purpose
Architecture
Review
How to test this PR?
Please describe here the various use cases to test this pull request