Skip to content

Commit

Permalink
fix: fix bridge with getStringProperty on InputElement.
Browse files Browse the repository at this point in the history
  • Loading branch information
andycall committed Jun 2, 2021
1 parent a5d0420 commit ea52672
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions bridge/bindings/jsc/DOM/element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ BoundingClientRect::BoundingClientRect(JSContext *context, NativeBoundingClientR
: HostObject(context, "BoundingClientRect"), nativeBoundingClientRect(boundingClientRect) {}

JSValueRef ElementInstance::getStringValueProperty(std::string &name) {
getDartMethod()->flushUICommand();
JSStringRef stringRef = JSStringCreateWithUTF8CString(name.c_str());
NativeString *nativeString = stringRefToNativeString(stringRef);
NativeString *returnedString = nativeElement->getStringValueProperty(nativeElement, nativeString);
Expand Down
6 changes: 6 additions & 0 deletions integration_tests/specs/dom/nodes/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,10 @@ describe('DOM Element API', () => {
expect(container.children[0]).toBe(a);
expect(container.children[1]).toBe(b);
});

it('should work with string value property', () => {
let input = document.createElement('input');
input.value = 'helloworld';
expect(input.value).toBe('helloworld');
});
});

0 comments on commit ea52672

Please sign in to comment.