Skip to content

Commit

Permalink
Merge pull request #4515 from alvarotrigo/dev
Browse files Browse the repository at this point in the history
Merging dev branch 4.0.17
  • Loading branch information
alvarotrigo committed Feb 16, 2023
2 parents 216d241 + 1f1b404 commit 0d45ac1
Show file tree
Hide file tree
Showing 21 changed files with 54 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

---

![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.16-brightgreen.svg)
![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.17-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion dist/fullpage.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 4.0.16
* fullPage 4.0.17
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down
6 changes: 3 additions & 3 deletions dist/fullpage.extensions.min.js

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions dist/fullpage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 4.0.16
* fullPage 4.0.17
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down Expand Up @@ -777,6 +777,10 @@
} while (!matches(item, topParentSelector));

return parents;
}
function isInsideInput() {
var activeElement = doc.activeElement;
return matches(activeElement, 'textarea') || matches(activeElement, 'input') || matches(activeElement, 'select') || getAttr(activeElement, 'contentEditable') == "true" || getAttr(activeElement, 'contentEditable') == '';
} //utils are public, so we can use it wherever we want
// @ts-ignore

Expand Down Expand Up @@ -871,7 +875,8 @@
getLast: getLast,
getAverage: getAverage,
setSrc: setSrc,
getParentsUntil: getParentsUntil
getParentsUntil: getParentsUntil,
isInsideInput: isInsideInput
});

function _typeof(obj) {
Expand Down Expand Up @@ -2863,9 +2868,13 @@
}
},
preventScrollWithKeyboard: function preventScrollWithKeyboard(e) {
if (!scrollOverflowHandler.isInnerScrollAllowed) {
preventDefault(e);
return false;
if (!isInsideInput() && getOptions().keyboardScrolling) {
var directionKeys = [38, 33, 32, 40, 34, 36, 35];

if (directionKeys.indexOf(e.keyCode) > -1 && !scrollOverflowHandler.isInnerScrollAllowed) {
preventDefault(e);
return false;
}
}
},
keyUpHandler: function keyUpHandler() {
Expand Down Expand Up @@ -4221,11 +4230,6 @@
clearTimeout(g_keydownId);
docRemoveEvent('keydown', keydownHandler);
docRemoveEvent('keyup', keyUpHandler);
}

function isInsideInput() {
var activeElement = doc.activeElement;
return matches(activeElement, 'textarea') || matches(activeElement, 'input') || matches(activeElement, 'select') || getAttr(activeElement, 'contentEditable') == "true" || getAttr(activeElement, 'contentEditable') == '';
} //Sliding with arrow keys, both, vertical and horizontal


Expand Down Expand Up @@ -5466,7 +5470,7 @@
});
});
var t = ["-"];
var n = "\x32\x30\x32\x33\x2d\x31\x2d\x32".split("-"),
var n = "\x32\x30\x32\x33\x2d\x31\x2d\x31\x36".split("-"),
e = new Date(n[0], n[1], n[2]),
r = ["se", "licen", "-", "v3", "l", "gp"];

Expand Down Expand Up @@ -5890,7 +5894,7 @@
}; //public functions


FP.version = '4.0.16';
FP.version = '4.0.17';
FP.test = Object.assign(FP.test, {
top: '0px',
translate3d: 'translate3d(0px, 0px, 0px)',
Expand Down
2 changes: 1 addition & 1 deletion dist/fullpage.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fullpage.min.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/fullpage.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lang/brazilian-portuguese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

---

![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.16-brightgreen.svg)
![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.17-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/chinese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

---

![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.16,2-brightgreen.svg)
![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.17,2-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/french/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

---

![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.16-brightgreen.svg)
![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.17-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/korean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</p>
---

![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.16-brightgreen.svg)
![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.17-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/russian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

---

![Версия fullPage.js](https://img.shields.io/badge/fullPage.js-v4.0.16-brightgreen.svg)
![Версия fullPage.js](https://img.shields.io/badge/fullPage.js-v4.0.17-brightgreen.svg)
[![Лицензия](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![Перечисление на PayPal](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/spanish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

---

![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.16-brightgreen.svg)
![fullPage.js version](https://img.shields.io/badge/fullPage.js-v4.0.17-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fullpage.js",
"version": "4.0.16",
"version": "4.0.17",
"description": "Create beautiful fullscreen snap scrolling websites",
"main": "dist/fullpage.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import resolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";

const licenseContent = `/*!
* fullPage 4.0.16
* fullPage 4.0.17
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down
2 changes: 1 addition & 1 deletion src/css/fullpage.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 4.0.16
* fullPage 4.0.17
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down
10 changes: 10 additions & 0 deletions src/js/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,16 @@ export function getParentsUntil(item, topParentSelector){
return parents;
}

export function isInsideInput(){
var activeElement = doc.activeElement;

return matches(activeElement, 'textarea') ||
matches(activeElement, 'input') ||
matches(activeElement, 'select') ||
getAttr(activeElement, 'contentEditable') == "true" ||
getAttr(activeElement, 'contentEditable') == '';
}

//utils are public, so we can use it wherever we want
// @ts-ignore
window["fp_utils"] = {
Expand Down
2 changes: 1 addition & 1 deletion src/js/fullpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function setAPI(){
};

//public functions
FP.version = '4.0.16';
FP.version = '4.0.17';

FP.test = Object.assign(FP.test, {
top: '0px',
Expand Down
11 changes: 1 addition & 10 deletions src/js/keyboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { moveSectionUp } from '../scroll/moveSectionUp.js';
import { moveSectionDown } from '../scroll/moveSectionDown.js';
import { moveTo } from '../scroll/moveTo.js';
import { events } from '../common/events.js';
import { isInsideInput } from '../common/utils.js';

let g_controlPressed;
let g_keydownId;
Expand Down Expand Up @@ -49,16 +50,6 @@ function onDestroy(){
utils.docRemoveEvent('keyup', keyUpHandler);
}

function isInsideInput(){
var activeElement = doc.activeElement;

return utils.matches(activeElement, 'textarea') ||
utils.matches(activeElement, 'input') ||
utils.matches(activeElement, 'select') ||
utils.getAttr(activeElement, 'contentEditable') == "true" ||
utils.getAttr(activeElement, 'contentEditable') == '';
}

//Sliding with arrow keys, both, vertical and horizontal
function keydownHandler(e) {
clearTimeout(g_keydownId);
Expand Down
2 changes: 1 addition & 1 deletion src/js/mixed/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions src/js/scrolloverflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { EventEmitter } from './common/eventEmitter.js';
import { getSlideOrSection } from './common/utilsFP.js';
import { getSectionFromPanel } from './sections.js';
import { events } from './common/events.js';
import { isInsideInput } from './common/utils.js';

let g_focusScrollableId;

Expand Down Expand Up @@ -64,9 +65,12 @@ export const scrollOverflowHandler = {
},

preventScrollWithKeyboard: function(e){
if(!scrollOverflowHandler.isInnerScrollAllowed){
utils.preventDefault(e);
return false;
if( !isInsideInput() && getOptions().keyboardScrolling ){
var directionKeys = [38, 33, 32, 40, 34, 36, 35];
if( directionKeys.indexOf(e.keyCode) > -1 && !scrollOverflowHandler.isInnerScrollAllowed){
utils.preventDefault(e);
return false;
}
}
},

Expand Down

0 comments on commit 0d45ac1

Please sign in to comment.