I want to implement on-focus and off-focus behavior for a field in a collection, specifically for a deeplink URL
field in a Post collection.
The goal is as follows:
- When a user begins typing in the URL field, the field enters an on-focus state.
- Once the user moves away from the field (i.e., the field loses focus), an off-focus event is triggered.
- At that point, a flow should be initiated to validate the entered URL.
The flow should perform an HTTP request to check if the URL returns a 200 OK
status:
- If the response is not 200, this indicates the URL is invalid.
- Directus should then notify the user that the URL is invalid, and prevent the post from being created until a valid URL is provided.