Skip to content
This repository was archived by the owner on Nov 17, 2024. It is now read-only.

Conversation

markmehere
Copy link
Contributor

@markmehere markmehere commented Sep 16, 2023

Often I only need the user to be able to use the default browser actions on one or two room.

For example to scroll through the achievements or to enter a high score.

This pull request introduces a boolean ct.permitDefault that can be set to true when calls to e.preventDefault(); should be suspended. The feature is implemented across ct.touch, ct.mouse, ct.pointer and ct.keyboard.

Incidentally (but unrelated to the PR) ct.pointer does not work on iOS, so please keep ct.touch around until Safari sorts this out.

This is another pull request in my attempts to cherry pick the most mature fixes from this branch and generate pull requests for them.

Copy link
Collaborator

@CosmoMyzrailGorynych CosmoMyzrailGorynych left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, but I don't like the placement of the setting. For ct.js v3, I would put it in ct.pointer and ct.touch. For v4, there will be a special settings object, buuut its API is yet to be formed.

I can approve this PR, but you still need to make a sister PR for docs.ctjs.rocks.

@markmehere markmehere changed the title ⚡ Introduces ct.permitDefault ⚡ Introduces ct.keyboard.permitDefault and ct.pointer.permitDefault Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants