diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiCollections.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiCollections.jsx index 41626613a5..0648d2ffc7 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiCollections.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/observe/api_collections/ApiCollections.jsx @@ -153,7 +153,7 @@ function ApiCollections() { }} > - +
func.handleKeyPress(e, createNewCollection)}> - +
) diff --git a/apps/dashboard/web/polaris_web/web/src/util/func.js b/apps/dashboard/web/polaris_web/web/src/util/func.js index 8e902ff39a..7e818977cb 100644 --- a/apps/dashboard/web/polaris_web/web/src/util/func.js +++ b/apps/dashboard/web/polaris_web/web/src/util/func.js @@ -1067,6 +1067,13 @@ getSizeOfFile(bytes) { } return duration.trim(); }, + handleKeyPress (event, funcToCall) { + const enterKeyPressed = event.keyCode === 13; + if (enterKeyPressed) { + event.preventDefault(); + funcToCall(); + } + } } export default func \ No newline at end of file