Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: version 15.6 is not working on iOS 9.3 and below (inputValueTracking.js) #9959

Closed
morten-olsen opened this issue Jun 14, 2017 · 2 comments

Comments

@morten-olsen
Copy link

It appears that version 15.6 does not work on older iOS devices (iOS 9.2 and 9.3 tested to be affected)

The root cause appears to be that Object.getOwnPropertyDescriptor is broken on these versions (it simply return undefined)
This method is used inside src/renderers/dom/shared/inputValueTracking.js, which causes React to break on ReactDOM.render causing nothing to be rendered

Error message:
TypeError: undefined is not an object (evaluating 's.get.call')

Stack trace:

get — inputValueTracking.js:70
postMountWrapper — ReactDOMInput.js:217
s — ReactDOMComponent.js:182
notifyAll — CallbackQueue.js:76
close — ReactReconcileTransaction.js:80
closeAll — Transaction.js:209
perform — Transaction.js:156
s — ReactMount.js:126
perform — Transaction.js:143
batchedUpdates — ReactDefaultBatchingStrategy.js:62
i — ReactUpdates.js:97
_renderNewRootComponent — ReactMount.js:319
_renderSubtreeIntoContainer — 1497445420246.mobile.js:37:84724
render — ReactMount.js:422
(anonymous function) — mobile.js:103
(anonymous function) — es6.promise.js:87
(anonymous function) — es6.promise.js:100
l — _microtask.js:18

Affected code:

track: function (inst) {
  if (getTracker(inst)) {
    return;
  }
  var node = ReactDOMComponentTree.getNodeFromInstance(inst);
  var valueField = isCheckable(node) ? 'checked' : 'value';
  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);

  var currentValue = '' + node[valueField];

  // if someone has already defined a value bail and don't track value
  // will cause over reporting of changes, but it's better then a hard failure
  // (needed for certain tests that spyOn input values)
  if (node.hasOwnProperty(valueField)) {
    return;
  }

  Object.defineProperty(node, valueField, {
    enumerable: descriptor.enumerable,
    configurable: true,
    get: function () {
      return descriptor.get.call(this);
    },
    set: function (value) {
      currentValue = '' + value;
      descriptor.set.call(this, value);
    }
  });
@morten-olsen morten-olsen changed the title BUG: version 15.6 breaking on iOS 9.3 and below (inputValueTracking.js) BUG: version 15.6 is not working on iOS 9.3 and below (inputValueTracking.js) Jun 14, 2017
@gaearon
Copy link
Collaborator

gaearon commented Jun 14, 2017

Thanks! This is already reported in #9956.

@gaearon gaearon closed this as completed Jun 14, 2017
@gaearon
Copy link
Collaborator

gaearon commented Jun 15, 2017

Should be fixed in 15.6.1. Please verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants