Skip to content

Weird bug with data-text-as-pseudo-element + ::before  #1145

Open
@MovingGifts

Description

@MovingGifts

It took all day to hunt this bug down and would love to find a solution.

It seems this bug is caused by the way this library renders RX.Text inside a RX.Button with data-text-as-pseudo-element + ::before combo.

To start, please use an iPad, open Safari, and then open a tab to any website you choose. Next, open a 2nd tab, and load the problematic React XP page) in the tab (code linked at bottom of post).

Now let the fun begin:

  1. In the text input field on the top, type '123'.
  2. You should see that there is:
    a. '123 People' that is just RX.Text
    b. '123' that is just white RX.Text in the orange RX.Button
    c. All works perfect so far.
  3. Now click the other tab you have open, wait a few seconds, and come back to the testing tab.
  4. Now, add '456' so it should read '123456' for both 2a and 2b.
  5. It shouldn't have worked for the button, only for the text.
  6. If it worked and you see '123456', try to add '789' after changing tabs with a few seconds wait.
  7. The button will basically not render the full reactive text input value, even though if you inspect it, it will show that the entire string is indeed the value for the button's data-text-as-pseudo-element attribute.

I noticed that the text in 2a always matches the text input value correctly because it does not use the data-text-as-pseudo-element + ::before combo. I also noticed that once the button is not matching the text input after switching tabs and coming back and adding some more text, that flipping the iPad causes it to "correct" itself and match the text input value. So it seems it needs a reflow/redraw of the button to occur for it to update correctly.

Would love to hear your thoughts on what solution we can implement so that the button matches the text input value without having to flip the iPad.

Updated links to view in chrome:
Here is the full screen link to reproduce
Here is a link with code

NOTE: It loads much faster in chrome, so I recommend checking out the code there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationplat: webPrimarily affects Web Browsers (and/or Electron)questionstaleThis ticket may be old, or may no longer be valid, and will be closed if no further activity occurs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions