mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 00:24:19 +08:00
`getBoundingClientRect()` calls `#getTriggerClientRect()` `#getTriggerClientRect()` calls `this.#view.coordsAtPos(head)` `coordsAtPos()` internally calls `getBoundingClientRect()` on the trigger element Which may creates an infinite loop / `Maximum call stack size exceeded`. This PR adds a `this.#calculatingCoords` guard to make sure we don't call `#getTriggerClientRect` again during the `coordsAtPos` call. To reproduce the issue, you can follow the same steps as the added test case: - type a `[link](link)` - cmd/ctrl-a to select all - type anything to replace it You should see a `Maximum call stack size exceeded` console output. |
||
|---|---|---|
| .. | ||
| category_templates_spec.rb | ||
| default_to_subcategory_spec.rb | ||
| dont_feed_the_trolls_popup_spec.rb | ||
| drafts_spec.rb | ||
| post_validation_spec.rb | ||
| prosemirror_editor_spec.rb | ||
| review_media_unless_trust_level_spec.rb | ||
| template_validation_spec.rb | ||