Skip to content

Commit

Permalink
fix on-page feedback in ai chat
Browse files Browse the repository at this point in the history
  • Loading branch information
chdeskur committed Mar 10, 2025
1 parent 712b362 commit 54999d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/fern-docs/bundle/src/components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ function useCommandTrigger(): [

React.useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (open) {
return;
}

setOpen((prev) => {
if (prev) {
return prev;
Expand Down Expand Up @@ -265,7 +269,7 @@ function useCommandTrigger(): [
return () => {
window.removeEventListener("keydown", handleKeyDown);
};
}, [setOpen]);
}, [open, setOpen]);

return [open, setOpen];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ export const DesktopCommandRoot = forwardRef<
onKeyDownCapture={composeEventHandlers(
props.onKeyDownCapture,
(e) => {
if (
document.activeElement instanceof HTMLInputElement ||
document.activeElement instanceof HTMLTextAreaElement
) {
return;
}

// if input is alphanumeric, space, backspace, delete, arrow left, arrow right, then focus input
// note: this func is onKeyDownCapture so it will fire before the input
// which is important so that the first character typed isn't swallowed
Expand Down

1 comment on commit 54999d8

@vercel
Copy link

@vercel vercel bot commented on 54999d8 Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

canary.ferndocs.com – ./packages/fern-docs/bundle

docs.airtop.ai
docs.reka.ai
*.ferndocs.app
docs.vapi.ai
docs.qlty.sh
docs.credal.ai
plantstore.dev
docs.bytebot.ai
docs.vellum.ai
docs.cable.tech
docs.mercoa.com
docs.multion.ai
docs.nominal.io
docs.ntropy.com
docs.revert.dev
docs.termina.ai
www.upshift.dev
api.labelstud.io
help.getzep.com
docs.airweave.ai
docs.argolabs.ai
docs.cartesia.ai
docs.eyelevel.ai
docs.coactive.ai
docs.coperniq.io
docs.getkard.com
docs.jambonz.org
docs.paradigm.co
docs.propexo.com
docs.payos.money
docs.scoutos.com
docs.trykeet.com
legal.fanvue.com
docs.upshift.dev
developers.ada.cx
docs.anterior.com
docs.agentmail.to
docs.benchify.com
docs.darwinbio.io
docs.getanalog.ai
docs.hellodata.ai
docs.mavenagi.com
docs.syndicate.io
docs.taxcloud.com
fern.ssoready.com
prod.ferndocs.com
docs.dataglade.com
docs.flagright.com
docs.fluidstack.io
docs.paradex.trade
docs.sphinxbio.com
docs.superagent.sh
docs.usebridge.com
docs.withchima.com
r2r-docs.sciphi.ai
www.katiedanny.com
developers.duve.com
api.navipartner.com
canary.ferndocs.com
docs.brightmove.com
docs.data.aviato.co
docs.openledger.com
docs.scrapybara.com
docs.privategpt.dev
docs.withabound.com
developers.awork.com
docs.athenaintel.com
docs.getscorecard.ai
docs.givechariot.com
docs.schematichq.com
docs.trypinnacle.app
tc.docs.syndicate.io
apidocs.polytomic.com
developer.ideogram.ai
docs-next.scoutos.com
docs.axiomatic-ai.com
docs.pier-finance.com
docs.wellesley.social
developers.beehiiv.com
developers.gappify.com
docs.stage.paradigm.co
developers.upwardli.com
reference.flatfile.com
docs.aiaplatform.com.au
docs.impiloplatform.com
secure.docs.propexo.com
docs.predictionguard.com
developer.yocobeta.co.za
documentation.sayari.com
gusto.docs.withchima.com
column.docs.withchima.com
docs.joincandidhealth.com
docs.conductorquantum.com
docs.staging.paradex.trade
rippling.docs.withchima.com
angellist.docs.withchima.com
dev.documentation.sayari.com
developer.projectmanager.com
docs-beta.projectmanager.com
upshift.dev

Please sign in to comment.