pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.38k stars 628 forks source link

During text edit, delete key tries to both delete selected text and any selected item in Object Explorer #7683

Closed paultobey closed 3 weeks ago

paultobey commented 1 month ago

Describe the bug

In Windows (I have not tested on other OSes), when I'm editing query text, pressing the Del key to delete the currently selected text or to delete the next character in the text editor also attempts to delete the selected object in Object Explorer, generating an are-you-sure dialog (and a lot of frustration ;-)

To Reproduce

Open a database, select a table. Open query editor. Select some text in the query or place the cursor where the Del key makes sense for text editing. Press Del. The text editor operation occurs, but you also get an are-your-sure error about deleting the selected table.

Expected behavior

When the text editor uses a key, it should not pass it up the chain to other potential consumers like Object Explorer. It should just do the text editing operation.

Screenshots

State before pressing Del key. Note that I most-recently selected the text in the query editor, NOT the table in the Object Explorer so this isn't an issue of what is focused.

pgAdmin 1

State after pressing Del key.

pgAdmin 2

State after dismissing are-your-sure with No. Note that the Del operation did the right thing in the query editor.

pgAdmin 3

Desktop (please complete the following information):

paultobey commented 1 month ago

I'll also note that using the Find or Replace dialog in the query editor also has the same problem: entering some search or replacement text then Del also asks if you want to delete the table.

adityatoshniwal commented 1 month ago

Hi @paultobey,

Check your shortcuts in preferences. Possibly overlapping.

image
paultobey commented 1 month ago

Hi @paultobey,

Check your shortcuts in preferences. Possibly overlapping. image

@adityatoshniwal Agreed. If I wanted to alter keyboard shortcuts I could work-around it. However, it seems reasonable to delete from Object Explorer when that control is focused and from the text editor when that is focused. For example, if we have two query editors open, we don't apply the Del key to both of them. I guess it feels like this should be the same case.

adityatoshniwal commented 1 month ago

@adityatoshniwal Agreed. If I wanted to alter keyboard shortcuts I could work-around it. However, it seems reasonable to delete from Object Explorer when that control is focused and from the text editor when that is focused. For example, if we have two query editors open, we don't apply the Del key to both of them. I guess it feels like this should be the same case.

I agree. Consider it as a workaround while we fix the issue.

paultobey commented 1 month ago

Much better in 8.10! Thanks!

pravesh-sharma commented 3 weeks ago

Issue fixed. Verified on snapshot build .

Env: OS - macOS 14.5 (Sonoma) Mode - Desktop