Repository navigation
Conversation
|
Build successful! 🎉 |
| role="presentation" | ||
| onKeyDown={onKeyDownProp} | ||
| onKeyUp={onKeyUpProp} | ||
| style={{width: '100%'}}> |
There was a problem hiding this comment.
i think this is only obvious if you have scrollbars turned on, but if you shift+enter until you hit the max height, the width of the input is actually super small and grows as you type which looks weird
There was a problem hiding this comment.
I think we could do style({flexGrow: 1, minWidth: 0}) here and remove the flexGrow: 1 from the TokenField.
|
Build successful! 🎉 |
|
Build successful! 🎉 |
| } | null>(null); | ||
| if ( | ||
| dismissed != null && | ||
| (!isFocused || dismissed.segments !== prompt.segments || dismissed.key !== key) |
There was a problem hiding this comment.
Nit: we can compute isDismissed above to avoid duplicating this.
| <Popover | ||
| triggerRef={inputRef} | ||
| isOpen={isOpen} | ||
| onOpenChange={open => { |
There was a problem hiding this comment.
In useCloseOnScroll, can we add:
(target instanceof HTMLElement && target.isContentEditable)
as a condition to the early return, so it won't close the popover if it opens while you're scrolled away and start typing @.
| expect(onKeyDown).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| describe('dismissing completions with Escape', () => { |
There was a problem hiding this comment.
Can we get one more test verifying that Escape:
- doesn't propagate to PromptTokenField's onKeyDown while the completion menu is open
- does propagate on a subsequent Escape once the menu is dismissed
#11029
Summary
In
PromptTokenField, pressing Escape does not close the completion popover.PromptTokenFieldPopovercontrolsisOpen, but does not passonOpenChangeto<Popover>.This change passes
onOpenChangeto<Popover>inPromptTokenFieldPopoverand stores adismissedstate ({segments, key}):dismissedand allow the popover to open again.📝 Test Instructions
PromptFieldstory.@ne. Verify that the completion menu opens.@nestays in the field, and focus stays in the field.@ne. Verify that the menu stays closed.Release impact
✅ PR Checklist
🧢 Your Project