Skip to content

Commit

Permalink
Merge branch 'main' into deps-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Dec 18, 2024
2 parents 4863555 + 7880bfc commit 910b93a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions android/capacitor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ android {
lintConfig file('lint.xml')
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
publishing {
singleVariant("release")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ private void deserializeConfig(@Nullable Context context) {
loggingEnabled = isDebug;
}

initialFocus = JSONUtils.getBoolean(configJSON, "android.initialFocus", initialFocus);
initialFocus = JSONUtils.getBoolean(
configJSON,
"android.initialFocus",
JSONUtils.getBoolean(configJSON, "initialFocus", initialFocus)
);

// Plugins
pluginsConfiguration = deserializePluginsConfig(JSONUtils.getObject(configJSON, "plugins"));
Expand Down
12 changes: 12 additions & 0 deletions cli/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ export interface CapacitorConfig {
*/
zoomEnabled?: boolean;

/**
* Whether to give the webview initial focus.
*
* @since 7.0.0
* @default true
*/
initialFocus?: boolean;

android?: {
/**
* Specify a custom path to the native Android project.
Expand Down Expand Up @@ -191,6 +199,8 @@ export interface CapacitorConfig {
/**
* Whether to give the webview initial focus.
*
* Overrides global `initialFocus` option.
*
* @since 3.5.1
* @default true
*/
Expand Down Expand Up @@ -453,6 +463,8 @@ export interface CapacitorConfig {
/**
* Whether to give the webview initial focus.
*
* Overrides global `initialFocus` option.
*
* @since 7.0.0
* @default true
*/
Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/CAPInstanceDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ internal extension InstanceDescriptor {
isWebDebuggable = true
#endif
}
if let initialFocus = config[keyPath: "ios.initialFocus"] as? Bool {
if let initialFocus = (config[keyPath: "ios.initialFocus"] as? Bool) ?? (config[keyPath: "initialFocus"] as? Bool) {
hasInitialFocus = initialFocus
}
}
Expand Down

0 comments on commit 910b93a

Please sign in to comment.