parent
							
								
									154233abdb
								
							
						
					
					
						commit
						2c09969b13
					
				@ -263,4 +263,11 @@ describe('runtime-dom: props patching', () => {
 | 
				
			|||||||
    )
 | 
					    )
 | 
				
			||||||
    expect(el.value).toBe('baz')
 | 
					    expect(el.value).toBe('baz')
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  test('translate attribute', () => {
 | 
				
			||||||
 | 
					    const el = document.createElement('div')
 | 
				
			||||||
 | 
					    patchProp(el, 'translate', null, 'no')
 | 
				
			||||||
 | 
					    expect(el.translate).toBeFalsy()
 | 
				
			||||||
 | 
					    expect(el.getAttribute('translate')).toBe('no')
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
				
			|||||||
@ -79,13 +79,13 @@ function shouldSetAsProp(
 | 
				
			|||||||
    return false
 | 
					    return false
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // spellcheck and draggable are numerated attrs, however their
 | 
					  // these are enumerated attrs, however their corresponding DOM properties
 | 
				
			||||||
  // corresponding DOM properties are actually booleans - this leads to
 | 
					  // are actually booleans - this leads to setting it with a string "false"
 | 
				
			||||||
  // setting it with a string "false" value leading it to be coerced to
 | 
					  // value leading it to be coerced to `true`, so we need to always treat
 | 
				
			||||||
  // `true`, so we need to always treat them as attributes.
 | 
					  // them as attributes.
 | 
				
			||||||
  // Note that `contentEditable` doesn't have this problem: its DOM
 | 
					  // Note that `contentEditable` doesn't have this problem: its DOM
 | 
				
			||||||
  // property is also enumerated string values.
 | 
					  // property is also enumerated string values.
 | 
				
			||||||
  if (key === 'spellcheck' || key === 'draggable') {
 | 
					  if (key === 'spellcheck' || key === 'draggable' || key === 'translate') {
 | 
				
			||||||
    return false
 | 
					    return false
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user