Skip to content

Commit

Permalink
[examples] Add example of URL field which allows relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Feb 4, 2021
1 parent 4b102a2 commit 468c40f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/test-studio/schemas/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ export default {
type: 'url',
title: 'Plain url',
description: 'A plain URL field',
// validation: (Rule) =>
// Rule.uri({
// scheme: ['http', 'https', 'mailto', 'tel'],
// }),
},
{
name: 'relativeUri',
type: 'url',
title: 'Relative url',
description: 'A relative URL field',
validation: (Rule) =>
Rule.uri({
scheme: ['http', 'https', 'mailto', 'tel'],
allowRelative: true,
}),
},
],
}

0 comments on commit 468c40f

Please sign in to comment.