VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Roderic on April 12, 2018, 16:55:55 PM

Title: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: Roderic on April 12, 2018, 16:55:55 PM
Since the 3.2.14 update, removing the "old JS" (Revision 9780), made it so that the "Search.." text doesn't remove "onfocus" and you'll have to manually remove it yourself.
I put back a previous version of /modules/mod_virtuemart_search/tmp/default.php and it works again as it should.

I can of course make an override in my template, but since this is a bug, I thought I better report it.
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: maxispin on April 15, 2018, 18:21:09 PM
Yes. The default text (or added) has to be cleared manually each time.

Workaround: Type one empty space in the default text .   " "   (without quotes)
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: stawebnice on April 19, 2018, 13:49:28 PM
Quick fix for this before it is solved is to add this language override with empty translation:

MOD_VIRTUEMART_SEARCH_TEXT_TXT

Go to Extensions - Languages - Overrides - select site language (s) and click NEW button to create a new language override - enter only MOD_VIRTUEMART_SEARCH_TEXT_TXT in language constant field and leave "text" empty, that  will do

then it does not display the text - only word search in your language and no one has to delete anything before typing in the search query

Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: StefanSTS on April 20, 2018, 08:01:50 AM
Hi,

the old js was replaced by the HTML attribute placeholder.
The attribute might work differently in different browsers. Which browser are you using?

In Firefox, Chrome, Opera and Midori on Ubuntu Linux the behaviour is as expected.
- The placeholder is in the search field in light grey.
- On focus it does not disappear.
- On typing the first letter, the placeholder is replaced by the first typed letter.
- On removing the typed letter(s) the placeholder reappears.

Does anyone have different results? Please state with browser name and version.

Regards
Stefan

PS. The used variable in the code ist $button_text (default: MOD_VIRTUEMART_SEARCH_GO), that is indeed wrong, it should be $text (default: MOD_VIRTUEMART_SEARCH_TEXT_TXT). You can change these default values in the search module settings.
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: StefanSTS on April 25, 2018, 11:29:22 AM
Just in case someone wants to change the behaviour and make the placeholder disappear on focus.

This CSS should do for most browsers:

input:focus:-moz-placeholder {color:transparent;}
input:focus::-moz-placeholder {color:transparent;}
input:focus::-webkit-input-placeholder {color:transparent;}
input:focus:-ms-input-placeholder {color:transparent;}

Hope it helps
Stefan
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: sandomatyas on June 18, 2018, 08:59:32 AM
Quote from: StefanSTS on April 20, 2018, 08:01:50 AM
Hi,

the old js was replaced by the HTML attribute placeholder.
The attribute might work differently in different browsers. Which browser are you using?

In Firefox, Chrome, Opera and Midori on Ubuntu Linux the behaviour is as expected.
- The placeholder is in the search field in light grey.
- On focus it does not disappear.
- On typing the first letter, the placeholder is replaced by the first typed letter.
- On removing the typed letter(s) the placeholder reappears.

Does anyone have different results? Please state with browser name and version.

Regards
Stefan

PS. The used variable in the code ist $button_text (default: MOD_VIRTUEMART_SEARCH_GO), that is indeed wrong, it should be $text (default: MOD_VIRTUEMART_SEARCH_TEXT_TXT). You can change these default values in the search module settings.

Very annoying bug. Firefox 60.
But it's in the code.
I checked the code in VM 3.2.15.9877, but it's the same :/
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: p.barg on June 18, 2018, 09:12:29 AM
In my tests the placeholder doesn't disappear on typing the first letter...
Tried with FF  60.0.2, Chrome 67.0.3396.87
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: sandomatyas on June 18, 2018, 17:10:00 PM
Quote from: p.barg on June 18, 2018, 09:12:29 AM
In my tests the placeholder doesn't disappear on typing the first letter...
Tried with FF  60.0.2, Chrome 67.0.3396.87

Because this isn't the placeholder param, it's the default value param of the input
Title: Re: 3.2.14 - Text in Virtuemart Search Module doesn't clear
Post by: Milbo on June 18, 2018, 20:57:35 PM
New version is in the trunk http://dev.virtuemart.net/projects/virtuemart/repository/changes/trunk/virtuemart/modules/mod_virtuemart_search/mod_virtuemart_search.php