Code Monkey home page Code Monkey logo

Comments (7)

WofWca avatar WofWca commented on September 26, 2024 1
  • You might want to first translate a piece of text, then copy it (the original text). Because of this bug(?) you have to select the target text twice.
  • If you go to settings and decide to enable "Quick translation by selection" you practically have to also add a modifier key, otherwise you can't copy any text from a website. This is at least a UX issue of the options page.

from linguist.

vitonsky avatar vitonsky commented on September 26, 2024

This behavior needs for accessibility. When user select text, they focus on button to translate selected text or on popup with translated text.

Why you need to change this behavior? Whats problems occurs due to this behavior?

from linguist.

WofWca avatar WofWca commented on September 26, 2024

This behavior needs for accessibility.

I understand that focusing the popup might make sense, but there should be a way to also keep the selection. For example, in Chromium you can select text and then change focus with tab and the text won't get unselected (this doesn't appear to be the case for Gecko though).

Whats problems occurs due to this behavior?

As I mentioned, with "Quick translation by selection" you practically can't copy any text on the page. Or you have to resort to waiting for translation to complete, then copy the original text from the translation popup.

Without "Quick translation by selection", you might also want to first translate selected text, then copy it. Currently you'd have to select it again.

from linguist.

vitonsky avatar vitonsky commented on September 26, 2024

Option "Quick translation by selection" needs for fast translation selected text. You should to pick some modifiers keys to not translate any selected text.

If you pick some modifier keys for this option, is some problems with behavior leave for you?

from linguist.

WofWca avatar WofWca commented on September 26, 2024

Firstly, apologies, I just found out that the issue affects Gecko (Firefox) only (not Chromium).

If you pick some modifier keys for this option, is some problems with behavior leave for you?

You're right, adding a modifier key can improve things in some cases. But still it's preferable if the text selection is kept.

  • If changing focus is necessary, maybe we need to search for a way to keep the selection.
  • Maybe need to also add an option to not focus the popup. And, additionally, maybe change the effective tabindex of the popup, as I mentioned.
  • If none of the above, either way I think that the deselection with "Quick translation by selection" is frustrating, and should not manifest itself after you've just installed the extension and only changed the "Translation trigger" option. Perhaps with "Quick translation by selection" a modifier key should also be required to be pressed by default.

from linguist.

vitonsky avatar vitonsky commented on September 26, 2024

I will investigate your approach with tab index. I'm not sure it will works with elements in shadowRoot, but i will try, because it may be good solution.

We could restore selection, but i still do not understand whats problems you have due to current behavior.
Please, explain why you want to preserve selection. If you have multiple problems due to this behavior, write it one by one and let's discuss each one.

from linguist.

vitonsky avatar vitonsky commented on September 26, 2024

@WofWca both use case available right now. You can select text, copy it and then translate.

When you translate text, you focuse on popup with translation, it is pointless to preserve selection, because focused element is not a selection container.

Also, when you press button to translate selected text, you manually focus on this button (and then on popup), so it's a expected behavior that selection will reset and focus will change on button.

I still not see why you want to selection will preserved.

I will check behavior in chromium browsers, if this behavior different of firefox, i will make it consistent.

from linguist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.