File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ < script >
2+ const input = document . getElementById ( 'pwa_short_name' ) ;
3+ const maxLength = 12 ;
4+
5+ input . addEventListener ( 'input' , ( ) => {
6+ // Use Array.from to count characters correctly
7+ const inputChars = Array . from ( input . value ) ;
8+
9+ // If input exceeds maxLength, truncate it
10+ if ( inputChars . length > maxLength ) {
11+ input . value = inputChars . slice ( 0 , maxLength ) . join ( '' ) ;
12+ }
13+ } ) ;
14+ </ script >
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ public function pwa_short_sitename($value, $key)
213213 {
214214 $ placeholder = $ this ->trim_shortname ($ this ->config ['sitename ' ]);
215215
216- return '<input id=" ' . $ key . '" type="text" size="40" maxlength="12 " name="config[ ' . $ key . ']" value=" ' . $ value . '" placeholder=" ' . $ placeholder . '"> ' ;
216+ return '<input id=" ' . $ key . '" type="text" size="40" maxlength="24 " name="config[ ' . $ key . ']" value=" ' . $ value . '" placeholder=" ' . $ placeholder . '"> ' ;
217217 }
218218
219219 /**
You can’t perform that action at this time.
0 commit comments