File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export const EntryTitleInput: FunctionComponent<Props> = ({
63
63
onBlur = { ( ) => onCommit ( currentValue , true ) }
64
64
onKeyUp = { handleKeyUp }
65
65
ref = { select }
66
+ autoComplete = "new-directory"
66
67
value = { currentValue }
67
68
id = { `input-${ id } ` }
68
69
aria-invalid = { Boolean ( error ) }
Original file line number Diff line number Diff line change 1
1
export default ( id , title , siblings = [ ] ) => {
2
2
if ( title . length === 0 ) return 'Title cannot be empty' ;
3
- if ( / ^ [ 0 9 a z A Z _ . ] + $ / . test ( title ) ) {
3
+ if ( title . includes ( ' ' ) ) {
4
4
// It has whitespaces
5
- return 'Title cannot have whitespaces or special characters' ;
5
+ return 'Title cannot have whitespaces' ;
6
+ }
7
+ if ( / [ ! @ # $ % ^ & * ( ) , . ? " : { } | < > ] / g. test ( title ) ) {
8
+ return 'Title cannot have special characters' ;
6
9
}
7
10
8
11
if ( title . length > 32 ) {
You can’t perform that action at this time.
0 commit comments