Bug 564510 - Clear translation hint button doesn't work first time
Summary: Clear translation hint button doesn't work first time
Status: NEW
Alias: None
Product: Babel
Classification: Technology
Component: Server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Babel server inbox CLA
QA Contact:
URL: /babel/translate.php
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-21 03:49 EDT by Andrew Johnson CLA
Modified: 2024-06-02 03:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2020-06-21 03:49:01 EDT
To reproduce (on Firefox 77.0.1, Chrome 83.0.4103.106)

From https://babel.eclipse.org/babel/translate.php
Select a language, project, version, file, string to translate.

Translation Hints [Clear]
Select some English text above to find similar translations

Select some text
Some suggestions come back or else 
'No hints found. Press [clear] to start over.'

whichever happens, clear does nothing. It links to javascript:void();


However if you first press [Clear] which links to javascript:clearHints(); then that clears the initial hint text.
Then select some text.
A suggestion comes back or
'No hints found. Press [clear] to start over.'

The clear button now works, even though it links to javascript:void();


I think the problem is in translationHints.js

There might be a race condition between
setting the button HTML
https://git.eclipse.org/c/babel/server.git/tree/html/js/translationHint.js#n22
domNode.innerHTML = "Translation Hints [<a id=\"clear-btn\"href=\"javascript:void(0);\">Clear</a>]";	

and setting the operation:
https://git.eclipse.org/c/babel/server.git/tree/html/js/translationHint.js#n29
	this.setupCB();

Perhaps the operation gets set first on the button, then the button anchor changes, and the operation gets lost.


I can fix it via GreaseMonkey by moving the setupCB() call to after setting the
innerHTML.
Comment 1 Eclipse Genie CLA 2022-06-12 08:22:40 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Andrew Johnson CLA 2022-06-12 09:07:28 EDT
Still a problem.
Tested with Firefox 101.0 (64-bit
Comment 3 Eclipse Genie CLA 2024-06-02 03:56:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.