V
V
vasIvas2017-09-25 17:03:31
Browsers
vasIvas, 2017-09-25 17:03:31

What is the name of this state?

Open the browser console, highlight any word from this message and click on the console.
The selection will change color. What is the name of this state and how to create it programmatically?
And it seems to me that this is not a loss of focus, since the loss of focus completely removes the selection.
Also, it's not because the console isn't part of the interface. In google docs, the same state
is obtained when clicking on the menu, which is part of ui.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Sokolov, 2017-09-25
@vasIvas

In my opinion, this is a system -based text selection, it does not depend on the browser, but on the system. This is the piece of text that will be copied to the buffer when you press Cmd + C on the keyboard, which will disappear if you start typing (if we edit this text).
Within one browser window, it will not be possible to select several fragments of text. But in different on the same page - it works for me (FireFox, OS X) ( try )<frame>

Screenshot
ddf68eae93c64b12b09abe75cf545fe9.png
Upd. I mean, it's impossible to make multiple selections within one "window". A window , or rather, a context , is either a document in an application (not just a browser), or a frame in one browser window, or additional. panels in the application interface (eg address bar in a browser).
At the same time, several fragments of text cannot be actively-selected in one computer / session - what will be copied if you press Ctrl / Cmd + C on the keyboard.
Therefore, that only active one is highlighted in blue (or how the system is configured - Windows or OS X). And all the others turn grey. At the same time, within the framework of those other, gray applications, the selections remain relevant-active, they do not lose focus.

O
oh, 2017-09-25
well @AnneSmith

I found only old complaints that the Internet Explorer does not keep the selection when focus is lost, apparently since then
no special state or event has been fixed, except for blur and focusout, these topics are not discussed
, that is, it is only the browser that keeps the selection for user convenience until the next focus

V
Viktor Yanyshev, 2017-09-25
@villiwalla

In css it's ::selected

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question