Skip to content

Commit

Permalink
preventDefault on folder create submit event
Browse files Browse the repository at this point in the history
Currently when navigating to the group folders settings and pressing create, it will triger the form submit navigation to `settings/admins/groupfolders#?`.
Once you're at the url with `#` the form submit will no longer triger a page nagivation.

Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Mar 15, 2021
1 parent e668887 commit 725ddd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/settings/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import {ChangeEvent, Component} from 'react';
import {ChangeEvent, Component, FormEvent} from 'react';

import {Api, Folder, Group, ManageRuleProps, OCSGroup, OCSUser} from './Api';
import {FolderGroups} from './FolderGroups';
Expand Down Expand Up @@ -57,7 +57,8 @@ export class App extends Component<{}, AppState> implements OC.Plugin<OC.Search.
OC.Plugins.register('OCA.Search.Core', this);
}

createRow = () => {
createRow = (event: FormEvent) => {
event.preventDefault();
const mountPoint = this.state.newMountPoint;
if (!mountPoint) {
return;
Expand Down

0 comments on commit 725ddd0

Please sign in to comment.