@@ -155,6 +155,45 @@ describe('FocusScope', function () {
155155 expect ( document . activeElement ) . toBe ( input1 ) ;
156156 } ) ;
157157
158+ it ( 'should only skip content editable which are false' , async function ( ) {
159+ let { getByTestId} = render (
160+ < FocusScope contain >
161+ < input data-testid = "input1" />
162+ < span contentEditable data-testid = "input2" />
163+ < span contentEditable = "false" />
164+ < span contentEditable = { false } />
165+ < span contentEditable = "plaintext-only" data-testid = "input3" />
166+ < input data-testid = "input4" />
167+ </ FocusScope >
168+ ) ;
169+
170+ let input1 = getByTestId ( 'input1' ) ;
171+ let input2 = getByTestId ( 'input2' ) ;
172+ let input3 = getByTestId ( 'input3' ) ;
173+ let input4 = getByTestId ( 'input4' ) ;
174+
175+ act ( ( ) => { input1 . focus ( ) ; } ) ;
176+ expect ( document . activeElement ) . toBe ( input1 ) ;
177+
178+ await user . tab ( ) ;
179+ expect ( document . activeElement ) . toBe ( input2 ) ;
180+
181+ await user . tab ( ) ;
182+ expect ( document . activeElement ) . toBe ( input3 ) ;
183+
184+ await user . tab ( ) ;
185+ expect ( document . activeElement ) . toBe ( input4 ) ;
186+
187+ await user . tab ( { shift : true } ) ;
188+ expect ( document . activeElement ) . toBe ( input3 ) ;
189+
190+ await user . tab ( { shift : true } ) ;
191+ expect ( document . activeElement ) . toBe ( input2 ) ;
192+
193+ await user . tab ( { shift : true } ) ;
194+ expect ( document . activeElement ) . toBe ( input1 ) ;
195+ } ) ;
196+
158197 it ( 'should do nothing if a modifier key is pressed' , function ( ) {
159198 let { getByTestId} = render (
160199 < FocusScope contain >
0 commit comments