diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-fix-alignment-on-title-optimization b/projects/plugins/jetpack/changelog/update-jetpack-ai-fix-alignment-on-title-optimization new file mode 100644 index 0000000000000..8d8efabbcec39 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-fix-alignment-on-title-optimization @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Title Optimization: handle enter/return key to trigger a generation when they are pressed. diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.scss b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.scss index 13351b2e7751c..21523eec8dde8 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.scss +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.scss @@ -6,6 +6,11 @@ display: flex; justify-content: center; + // The element created by the KeyboardShortcuts component + div { + width: 100%; + } + textarea { width: 100%; outline: none; diff --git a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.tsx b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.tsx index 25492788c10c7..2dcbe7e702a32 100644 --- a/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.tsx +++ b/projects/plugins/jetpack/extensions/plugins/ai-assistant-plugin/components/title-optimization/title-optimization-keywords.tsx @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import { Button } from '@wordpress/components'; +import { Button, KeyboardShortcuts } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import './title-optimization-keywords.scss'; @@ -25,17 +25,28 @@ export default function TitleOptimizationKeywords( { return (
- + { + if ( ! disabled ) { + onGenerate(); + } + }, + } } + > + +