From 10ba5b306d3d1a9d7ac694a19e70b7b7afca208d Mon Sep 17 00:00:00 2001 From: atomiks Date: Sun, 24 Mar 2019 08:36:58 +1100 Subject: [PATCH 1/2] Remove need for explicit multiple prop --- src/Tippy.js | 2 ++ test/Tippy.test.js | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Tippy.js b/src/Tippy.js index bc21ee6..60cb8bc 100644 --- a/src/Tippy.js +++ b/src/Tippy.js @@ -30,6 +30,7 @@ function Tippy({ isVisible, isEnabled = true, ignoreAttributes = true, + multiple = true, ...nativeProps }) { const [isMounted, setIsMounted] = useState(false) @@ -41,6 +42,7 @@ function Tippy({ const options = { ...nativeProps, ignoreAttributes, + multiple, content: containerRef.current, } diff --git a/test/Tippy.test.js b/test/Tippy.test.js index e63ff82..696b9b7 100644 --- a/test/Tippy.test.js +++ b/test/Tippy.test.js @@ -168,14 +168,15 @@ describe('', () => { test('nesting', () => { render( - - - + + + , ) + expect(document.querySelectorAll('.tippy-popper').length).toBe(3) }) test('props.isEnabled initially `true`', () => { From bda490f24d1aba12bdf7b8657263f09638a0ae0b Mon Sep 17 00:00:00 2001 From: atomiks Date: Sun, 24 Mar 2019 08:47:47 +1100 Subject: [PATCH 2/2] =?UTF-8?q?...nativeProps=20=E2=86=92=20...restOfNativ?= =?UTF-8?q?eProps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Tippy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tippy.js b/src/Tippy.js index 60cb8bc..aeb559e 100644 --- a/src/Tippy.js +++ b/src/Tippy.js @@ -31,7 +31,7 @@ function Tippy({ isEnabled = true, ignoreAttributes = true, multiple = true, - ...nativeProps + ...restOfNativeProps }) { const [isMounted, setIsMounted] = useState(false) const containerRef = useRef(ssrSafeCreateDiv()) @@ -40,9 +40,9 @@ function Tippy({ const isControlledMode = typeof isVisible === 'boolean' const options = { - ...nativeProps, ignoreAttributes, multiple, + ...restOfNativeProps, content: containerRef.current, }