From 82a7099b35e6b423e6e8d1901e9a482b228d76e1 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Mon, 20 Jun 2022 18:22:37 -0500 Subject: [PATCH] possesive adding bug --- package.json | 2 +- src/components/np-picker/NPPicker.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8c7adc1..3aca11b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "2.9.9", + "version": "3.0.0", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/components/np-picker/NPPicker.tsx b/src/components/np-picker/NPPicker.tsx index 8c8981b..89bb7f5 100644 --- a/src/components/np-picker/NPPicker.tsx +++ b/src/components/np-picker/NPPicker.tsx @@ -31,7 +31,11 @@ function NPPicker(props: { const [addingPoss, setAddingPoss] = useState(false); const [npType, setNpType] = useState(props.np ? props.np.selection.type : undefined); const onChange = (np: T.NPSelection | undefined) => { - props.onChange(ensureSingleShrink(props.np, np)) + props.onChange(ensureSingleShrink(props.np, np)); + if ((np?.selection.type === "noun" || np?.selection.type === "participle") && np.selection.possesor) { + setAddingPoss(true); + } + setAddingPoss(false); } useEffect(() => { setNpType(props.np ? props.np.selection.type : undefined);