File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ //trim leading / trailing spaces form input fields
2+ export default function handleAutoTrimInputs ( ) {
3+ document . querySelectorAll ( 'input[type="text"]' ) . forEach ( ( input ) => {
4+ input . addEventListener ( 'change' , function ( ) {
5+ this . value = this . value . trim ( ) ;
6+ } ) ;
7+ } ) ;
8+ }
Original file line number Diff line number Diff line change 11import alpineInit from './alpineInit' ;
22import focusFirstInput from './focusFirstInput' ;
33import handleAddIpLists from './addIpLists' ;
4+ import handleAutoTrimInputs from './autoTrimInputs' ;
45import handleConfirmAction from './confirmAction' ;
56import handleCopyCreds from './copyCreds' ;
67import handleClipboardCopy from './clipboardCopy' ;
@@ -33,6 +34,7 @@ focusFirstInput();
3334
3435function initListeners ( ) {
3536 handleAddIpLists ( ) ;
37+ handleAutoTrimInputs ( ) ;
3638 handleConfirmAction ( ) ;
3739 handleCopyCreds ( ) ;
3840 handleClipboardCopy ( ) ;
You can’t perform that action at this time.
0 commit comments