Răsfoiți Sursa

[hide] Use default Ctrl+Z behavior in range text input instead of the one used by hide

Clément Espeute 8 luni în urmă
părinte
comite
6ea361940a
1 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 8 0
      hide/comp/Range.hx

+ 8 - 0
hide/comp/Range.hx

@@ -64,6 +64,14 @@ class Range extends Component {
 			onChange(true);
 		});
 
+		inputView.keypress((e) -> {
+			e.stopPropagation(); // Prevent things like ctrl+Z from getting caught by hide while we are editting
+		});
+
+		inputView.keydown((e) -> {
+			e.stopPropagation(); // Prevent things like ctrl+Z from getting caught by hide while we are editting
+		});
+
 		inputView.keyup(function(e) {
 			if( e.keyCode == 13 || e.keyCode == 27 ) {
 				inputView.blur();