File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed
Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 707707 objNode . attributes [ attribute . name ] = attribute . value ;
708708 }
709709 }
710- if ( aNode . childNodes && aNode . childNodes . length > 0 ) {
710+ if ( objNode . nodeName === 'TEXTAREA' ) {
711+ objNode . value = aNode . value ;
712+ } else if ( aNode . childNodes && aNode . childNodes . length > 0 ) {
711713 objNode . childNodes = [ ] ;
712714 nodeArray = Array . prototype . slice . call ( aNode . childNodes ) ;
713715 length = nodeArray . length ;
11101112 break ;
11111113 case this . _const . modifyTextElement :
11121114 node . data = diff [ this . _const . newValue ] ;
1113-
1114- if ( parentNode . nodeName === 'TEXTAREA' ) {
1115- parentNode . value = diff [ this . _const . newValue ] ;
1116- }
11171115 break ;
11181116 case this . _const . modifyValue :
11191117 node . value = diff [ this . _const . newValue ] ;
Original file line number Diff line number Diff line change @@ -192,7 +192,29 @@ <h1>Form element test for diffDOM</h1>
192192
193193 theDiff = dd . diff ( first , second ) ;
194194
195- if ( theDiff . length === 2 ) {
195+ if ( theDiff . length === 1 ) {
196+ success ( theDiff ) ;
197+ } else {
198+ testFailure ( ) ;
199+ console . log ( theDiff ) ;
200+ }
201+
202+ reportDiv ( ) ;
203+
204+ second . innerText = 'Some text' ;
205+ third . innerText = 'Some other text' ;
206+
207+ reportDivDescription ( first , second ) ;
208+
209+ theDiff = dd . diff ( first , second ) ;
210+
211+ dd . apply ( first , theDiff ) ;
212+
213+ theDiff = dd . diff ( first , third ) ;
214+
215+ dd . apply ( first , theDiff ) ;
216+
217+ if ( first . value === third . value ) {
196218 success ( theDiff ) ;
197219 } else {
198220 testFailure ( ) ;
You can’t perform that action at this time.
0 commit comments