Search bar drag & drop unbidden search Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
zerogravity

Search bar drag & drop unbidden search

Unread post by zerogravity » 2017-07-26, 19:49

Steps to reproduce:
1. Select Text
2. Drag it to the search bar and drop it.

Expected behaviour:
The text is copied to the search bar.

Actual behaviour:
The text is copied to the search bar and is submitted despite me neither clicking search nor pressing enter.

It is logical to expect drag & drop to act as a shortcut for rightclick -> copy -> move -> rightclick -> paste, which is the case in FF.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Search bar drag & drop unbidden search

Unread post by Moonchild » 2017-07-27, 18:17

I'm sorry but the expected behavior for dropping an item is to perform the default action on it.
If you drop a URL onto a browser, you'd expect it to open it. If you drop text on a search box, you'd expect it to launch a search for that text. If you drop an image on the browser, you'd expect it to display it. If you want to just paste the text, then paste the text...? :)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

zerogravity

Re: Search bar drag & drop unbidden search

Unread post by zerogravity » 2017-07-27, 19:50

Moonchild wrote:I'm sorry but the expected behavior for dropping an item is to perform the default action on it.
But then why is text that is dragged & dropped to the location/search bar copied but does not have the default action performed on it? I like it this way, but should it not at least be consistent?

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: Search bar drag & drop unbidden search

Unread post by adesh » 2017-07-30, 07:11

zerogravity wrote:I like it this way, but should it not at least be consistent?
Maybe the location bar knows only to deal with URLs. It sees random text as an invalid adress that you may want to correct.
Anyway you can use this inconsistency to your advantage and perform search.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Search bar drag & drop unbidden search

Unread post by Moonchild » 2017-07-31, 02:58

The address bar is primarily just that: for addresses/URLs. If you drop text that is an invalid URL, it's ambiguous whether it is a misspelled URL or an intended search, and as a result no action is the "default action" (you can thank the people who thought combining address bar and search functionality in one field was a good idea for that one).
If you drag a valid URL to the address bar, the browser will immediately browse to it since that is the default action for the address bar if given something valid.

Conversely, the search bar is *always* used only for searching, so no matter what is dropped there, the default action will always be a search.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked