Skip to content

Commit

Permalink
AI Assistant: Fix input z-index on moving block with inline extension (
Browse files Browse the repository at this point in the history
…#37322)

* add class with z-index to the input wrapper

* changelog
  • Loading branch information
dhasilva authored May 9, 2024
1 parent e352523 commit 9ccd6bb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

AI Client: Add className to AI Control component
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type { RequestingStateProp } from '../../types.js';
import type { ReactElement } from 'react';

type AIControlProps = {
className?: string;
disabled?: boolean;
value: string;
placeholder?: string;
Expand All @@ -37,6 +38,7 @@ type AIControlProps = {
* @returns {ReactElement} Rendered component
*/
export default function AIControl( {
className,
disabled = false,
value = '',
placeholder = '',
Expand All @@ -51,7 +53,10 @@ export default function AIControl( {
wrapperRef = null,
}: AIControlProps ): ReactElement {
return (
<div className="jetpack-components-ai-control__container-wrapper" ref={ wrapperRef }>
<div
className={ classNames( 'jetpack-components-ai-control__container-wrapper', className ) }
ref={ wrapperRef }
>
{ error }
<div className="jetpack-components-ai-control__container">
{ banner }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { RequestingStateProp } from '../../types.js';
import type { ReactElement, MouseEvent } from 'react';

type ExtensionAIControlProps = {
className?: string;
disabled?: boolean;
value: string;
placeholder?: string;
Expand Down Expand Up @@ -49,6 +50,7 @@ type ExtensionAIControlProps = {
*/
export function ExtensionAIControl(
{
className,
disabled = false,
value = '',
placeholder = '',
Expand Down Expand Up @@ -212,6 +214,7 @@ export function ExtensionAIControl(

return (
<AIControl
className={ className }
disabled={ disabled || loading }
value={ value }
placeholder={ placeholder }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

AI Assistant: Fix input z-index on moving block with inline extension
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import React from 'react';
*/
import useAICheckout from '../../../hooks/use-ai-checkout';
import useAiFeature from '../../../hooks/use-ai-feature';
import './style.scss';
/*
* Types
*/
Expand Down Expand Up @@ -157,6 +158,7 @@ export default function AiAssistantInput( {

return (
<ExtensionAIControl
className="jetpack-ai-assistant-extension-ai-input"
placeholder={ placeholder }
disabled={ disabled }
value={ value }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.jetpack-ai-assistant-extension-ai-input {
z-index: 1;
}

0 comments on commit 9ccd6bb

Please sign in to comment.