In an ellipse, you have several things that are related to each other:
- The location of one focus
- The location of the other focus
- The distance from one focus to the center
- The distance from one focus to the nearest vertex (one end of the major axis)
- The semimajor axis
- The semiminor axis
- The eccentricity
and a bunch of other things.
So you certainly can keep the semimajor axis constant and move the foci farther from the center and closer to the vertices of the ellipse.
But that is not what is being done in the other answer.
In that answer, the location of one focus is fixed and so is the distance from the focus to the nearest vertex (hence the location of that vertex is fixed as well).
Now we change the eccentricity. In order to keep the location of one focus and one vertex fixed, the other focus has to move, and so does the center.
Since the distance between the focus and the center changed, but the distance from the focus to the nearest vertex did not, the sum of those two distances (which is the semimajor axis) changed. Through the other relationships among the parts of the ellipse, the semiminor axis changed also.
It's all a matter of which family of ellipses you want to study.
Here are some of the specific measurements of the ellipse and the relationships among them. Let
\begin{align}
a &= \text{length of semimajor axis},\\
b &= \text{length of semiminor axis},\\
c &= \text{distance from center to focus},\\
e &= \text{eccentricity},\\
\ell &= \text{length of semilatus rectum},\\
p &= \text{distance from focus to the nearest vertex},
\end{align}
as in this figure adapated from https://en.wikipedia.org/wiki/File:Ellipse-param.svg:

(I relabeled parts of the figure to match the equations above, which follow some common conventions for labeling parts of an ellipse or parabola.)
The eccentricity is not labeled, but is it given by the formula
$$ e = \frac ca. \tag1 $$
Other relationships among the parameters are
\begin{align}
a^2 &= b^2 + c^2, \tag2\\
\ell &= \frac {b^2}{a}, \tag3\\
p &= a - c. \tag4
\end{align}
From $(1)$, we get $c = ae,$ so
$$ p = a - ae = a(1 - e). $$
Therefore if we hold $p$ constant but allow $e$ to vary,
$$ a = \frac{p}{1 - e}$$
and
$$ c = ae = p\frac{e}{1 - e}, $$
so $a$ and $c$ both go to infinity as $e$ approaches $1.$
From $(2)$, we have
$$b^2 = a^2 - c^2 = (a-c)(a+c) = p(a+ae) = p^2\frac{1+e}{1 - e},\tag5$$
which implies that as $e$ goes to $1,$
$b^2$ goes to infinity, and therefore so does $b$.
And that's how the semimajor axis depends on $e$ when you hold $p$ constant.
Plugging $(5)$ into $(3)$,
$$\ell = \frac {p(a+c)}{a} = p\left(1 + \frac ca\right) = p(1+e),$$
so as $e$ approaches $1,$ $\ell$ approaches $2p,$
which is the semilatus rectum of a parabola where the distance from the focus to the vertex is $p.$