Browser: Chrome 110 OS: macOS / Windows / Linux / etc. URL: Link to a page that illustrates this issue Video: Short screen recording that illustrates this issue (free tool: jam.dev)
Hello bricks team,
I have a button with the following text: Filters ({query_results_count_filter:jdlqmz})
The problem is that in the front end there is a space between count and the parentheses. But it displays well in Builder.
in builder
in frontend
This problem exists for dynamic data that is updated via Ajax. Is there a way to avoid this problem?
The reason why it is displayed correctly on the canvas is that there are additional tags within the button so that the element can be edited on the canvas. Accordingly, the gap is not applied there.
I will consult with the developers to see if they see a way to solve the problem directly.
Although adding a span is a simple and good solution, it creates additional nested DOM if you agree. For example, the HTML output would be like this just to show the query count:
I will consult with the developers to see if they see a way to solve the problem directly.
Great, thanks. But one question. How does the Woodmart theme display the query count with very text in a p tag while the query count is updated via Ajax? Please see this link. This approach will be great for clean code.
<p class="woocommerce-result-count">Showing all 4 results</p>
That’s why I’ve given you two potential solutions The first one doesn’t add anything to the HTML but simply solves the problem.
I don’t know, but they probably replace the whole string, not just the number. Ergo, you probably can’t adjust the text. However, this is also a completely different scenario (apples and oranges).
Your problem only occurs within a button because the button has a default gap.