|
@@ -11,6 +11,14 @@ const PagePathAutoComplete = (props) => {
|
|
|
addTrailingSlash, onClickSubmit, onInputChange, initializedPath,
|
|
addTrailingSlash, onClickSubmit, onInputChange, initializedPath,
|
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
+ function onChange(pages) {
|
|
|
|
|
+ const page = pages[0]; // should be single page selected
|
|
|
|
|
+
|
|
|
|
|
+ if (page != null) {
|
|
|
|
|
+ onInputChange(page.path);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function getKeywordOnInit(path) {
|
|
function getKeywordOnInit(path) {
|
|
|
return addTrailingSlash
|
|
return addTrailingSlash
|
|
|
? pathUtils.addTrailingSlash(path)
|
|
? pathUtils.addTrailingSlash(path)
|
|
@@ -21,6 +29,7 @@ const PagePathAutoComplete = (props) => {
|
|
|
<SearchTypeahead
|
|
<SearchTypeahead
|
|
|
crowi={props.crowi}
|
|
crowi={props.crowi}
|
|
|
onSubmit={onClickSubmit}
|
|
onSubmit={onClickSubmit}
|
|
|
|
|
+ onChange={onChange}
|
|
|
onInputChange={onInputChange}
|
|
onInputChange={onInputChange}
|
|
|
inputName="new_path"
|
|
inputName="new_path"
|
|
|
emptyLabelExceptError={null}
|
|
emptyLabelExceptError={null}
|
|
@@ -42,6 +51,7 @@ PagePathAutoComplete.propTypes = {
|
|
|
|
|
|
|
|
PagePathAutoComplete.defaultProps = {
|
|
PagePathAutoComplete.defaultProps = {
|
|
|
initializedPath: '/',
|
|
initializedPath: '/',
|
|
|
|
|
+ addTrailingSlash: true,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export default PagePathAutoComplete;
|
|
export default PagePathAutoComplete;
|