Ask a Question

Unable to clear a (material ui 5) datepicker field on Firefox - works fine on Edge and Chrome

SOLVED
Sabiha
Occasional Contributor

Unable to clear a (material ui 5) datepicker field on Firefox - works fine on Edge and Chrome

We have several date fields in our system, implemented using Material UI 5.10.2 datepicker. Our system is tested on Edge, Chrome and Firefox.

dateField.PNG

We have some tests that clear the text component part of the datepicker field using SetText("").

This is working fine on Edge and Chrome however on Firefox it does not clear the field. I have also tried using Keys("") followed by a Keys("[Tab]"], which does not work either 

Has anyone else come across this or anything similar to this?

Any ideas how I can clear the field in Firefox?

Thanks

2 REPLIES 2
AlexKaras
Champion Level 2

Hi,

 

Actually, .Keys("") does nothing, so I am not surprised that the field is not cleared. (To press Space key you should call .Keys(" ") -- space between quotes.)

What if you give a try to something like:

obj.Click(); // to set input focus into control;

obj.Keys("^A"); // Control-A to select all text (or "[Home]![End" -- Home, then Shift-End for the same purpose, or anything else that will select all text within control

obj.Keys("[Del]"); // Delete to clear the control

 

Does it help?

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
Sabiha
Occasional Contributor

Thanks Alex.

obj.Keys("^A");  didn't work for me on Firefox, it opened a new tab with showing add-ons 

 

however, this did work.

obj.Click();

obj.Keys(" "[Home]![End]") 

obj.Keys("[Del]");

 

cancel
Showing results for 
Search instead for 
Did you mean: