What does the preventdefault () method do when we put it in our custom function in flex?

What is the preventDefault() functionality in a flex or flash device?

+4
source share
2 answers

this tells event listeners that they should not do "what they usually did."

from Adobe docs:

"some events have associated default behavior. For example, the doubleClick event has an associated default behavior that highlights the word under the mouse pointer during the event. Your event listener can cancel this behavior by triggering a Default () warning. You can also make the current listener events are the last to handle the event by calling the stopPropagation () or stopImmediatePropagation () method.

+4
source

The preventDefault method of any event overrides the default behavior of the event. As you can see, how a text field can receive an input event and will output a letter for each letter entered. In this case, it overrides the default behavior and will not display the entered letter.

+2
source

All Articles