Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit e6dd3fe

Browse files
committed
fix(opportunities): adjust the scroll into form
1 parent e8fd71d commit e6dd3fe

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/pages/app-opportunities/app-opportunities.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,19 @@ export class AppOpportunities {
329329

330330
scrollToForm() {
331331
const form = document.getElementById('interviews');
332-
333332
form.scrollIntoView({ block: 'start', behavior: 'smooth' });
334333
}
335334

336335
scrollToApply() {
337-
const form = document.getElementById('applyForm');
338-
form.scrollIntoView({ block: 'start', behavior: 'smooth' });
336+
const element = document.getElementById('applyForm');
337+
const headerOffset = 30;
338+
const elementPosition = element.getBoundingClientRect().top;
339+
const offsetPosition = elementPosition - headerOffset;
340+
341+
window.scrollTo({
342+
top: offsetPosition,
343+
behavior: 'smooth',
344+
});
339345
}
340346

341347
changeMetadata() {

0 commit comments

Comments
 (0)