Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "X-Remote" header in Tab AJAX by default #3161

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mvorisek
Copy link
Contributor

This is documented in the docs - https://github.com/fomantic/Fomantic-UI-Docs/blob/5ad17488bc/server/documents/modules/tab.html.eco#L644.

But I belive this concept is not unified across the whole Fomantic UI and forcing an extra HTTP header is not wanted in general.

It is always possible to detect the AJAX load like in https://github.com/atk4/ui/blob/5.2.0/src/App.php#L343 if header approach is wanted and it is guaranteed by the XMLHttpRequest spec.

If any special handling for "tab load" is wanted, "apiSettings.data" should be used instead like in https://github.com/atk4/ui/blob/5.2.0/src/TabsTab.php#L39. This has an advantage to work even thru proxies which can strip unknown headers easily.

@lubber-de
Copy link
Member

While your arguments are valid and these days the backend can check "X-Requested-With" instead, i'll tag this as breaking change for 2.10 as peoples code might still rely on it.
Other components, like dropdown and search, do not use this header as the related backend for such components is supposed to always being used for ajax requests, but tab content could be whole HTML code, so the extra header was implemented only for tabs

We also should change the docs for a compatible workaround by using

$('tabselector').tab({
	apiSettings: {
	      headers: {
	          'X-Remote': true,
	      },
	}
});

@lubber-de lubber-de added this to the 2.10.x milestone Feb 3, 2025
@lubber-de lubber-de added tag/breaking-change Any pull request which is waiting for a breaking change release type/feat Any feature requests or improvements javascript Pull requests that update Javascript code state/awaiting-docs Pull requests which need doc changes/additions labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code state/awaiting-docs Pull requests which need doc changes/additions tag/breaking-change Any pull request which is waiting for a breaking change release type/feat Any feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants