Dear Retool Support Team,
I'm experiencing a strange and unexpected behavior in my Retool application and would appreciate your assistance in resolving this issue.
Issue Description: After submitting a text input once, subsequent changes to the input field are triggering the table's change page event handler, even though there's no direct connection between the input and the table besides the query.
Setup:
- Query:
WITH filtered_space_companies AS (
SELECT id, name, createdAt
FROM `_space_company` sc
WHERE {{ space_dashboard_table_search_filter?.value ? "sc.name LIKE '%" + space_dashboard_table_search_filter?.value + "%'" : "1=1" }}
)
SELECT
fsc.id,
fsc.name
FROM
filtered_space_companies fsc
LIMIT
{{ space_dashboard_table?.pagination?.pageSize }}
OFFSET
{{ space_dashboard_table?.pagination?.offset }}
- Query run behavior: Manual
- Text input: Has a query trigger on submit
- Table pagination: Server-side
- Table change page event handler:
- Triggers the query
- Sets a variable to Math.random() for testing purposes
Observed Behavior:
- Initially, changing the input does not trigger the table's change page event handler.
- After submitting the input once, any subsequent change to the input triggers the table's change page event handler.
- The variables set in the change page event handler are also changing with each input change.
Expected Behavior: The table's change page event handler should only trigger when changing the table's page, not when modifying the text input.
Questions:
- Why is the table's change page event being triggered by input changes after the first submission?
- Is there a hidden connection being established between the input and table after the first query run?
- How can I prevent this strange behavior and ensure the table's event handler only responds to actual page changes?
Any insights or suggestions on how to resolve this issue would be greatly appreciated. Please let me know if you need any additional information or clarification.
Thank you for your time and assistance.