Closed (works as designed)
Project:
Drupal core
Version:
8.6.17
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Sep 2019 at 13:18 UTC
Updated:
21 Nov 2019 at 12:07 UTC
Jump to comment: Most recent
Comments
Comment #2
josh.fabeanCan confirm I also experience this issue. I am currently investigating solutions.
Comment #3
chrisbudy commentedFinally had a chance to revisit this and look into it further. I was building suggestions based off of a $vars['element']['#id'] for hook_theme_suggesstions_input_alter() and hook_theme_form_element_alter(), but these values don't stay consistent. Upon submitting an AJAX form submission these values tack on some unique id to the end of the id name, which is what caused my templates to no longer be valid. So I had a template like input--edit-my-field-id.html.twig but after the form submit the id changed and was therefore looking for a template like input--edit-my-field-id-55FGSA1.html.twig.
So I switched over to making my theme suggestions based off of the element's #name property instead, as it is very similar, and doesn't change. This resolved my issue.