Affix does not move the child in the DOM. It renders the fixed element in place and puts the placeholder beside it, so a screen reader and a keyboard both reach the pinned element where it was written, whatever its visual position.
That is usually what you want, and it is also the mismatch to design around. Something painted at the top of the screen but written halfway down the document is read halfway down. A sighted reader sees it first, a screen reader user meets it last.
- Put the element you pin where it makes sense to read it, near the top of the section it belongs to, so the two orders stay close.
- Do not correct the mismatch with a positive tabindex on the child. A positive value reorders the entire page's tab sequence, not this one element, and the page is worse afterwards.
- A bar that is pinned for the whole document is content a keyboard reader passes every time they return to the top. If it holds more than a few controls, give it a skip link the way a site header gets one.