0

I have a Tinder script that I run on Tinder web. When I open a match, Tinder shows a textarea element which I can type the message to send to the match, if I type the text in it, the send button will be available to click, like this:

enter image description here

But if I insert the text in this textarea element by using JS code like this: document.querySelector("#c-582094868").value = 'my message' the button is not available:

enter image description here

My goal with this question is to understand why in the second case the button doesn't get enabled, it should, because the textarea element is filled with a text. What else could I do?

OBS1: #c-582094868 represents the textarea element in the DOM.

OBS2: I have tried already to set a value for the defaultValue, text, innerHTML in the textarea element. None of them worked.

Fabio Sousa
  • 261
  • 1
  • 2
  • 11

1 Answers1

1

Because the Tinder web app is build using React as its front-end framework. When you go in and directly edit the text-area the app is not aware of the change, nor does the change matter, due to the way react works.

In an other given js framework, this could have work, say for a vanilla js/jquery app. This is the separation of 1-way bind and 2-way bind frameworks when iit comes to front-ends ( react, knockout, angular, vue etc ) have different ways that they implement what you think of as the "apps inner workings"

MKougiouris
  • 2,821
  • 1
  • 16
  • 19